title: why does php extension development differ so much from c++ development?
body: <p>I've been a pretty long time PHP developer, and I'm starting to hit some limitations within the language. So, with that being said, I figured the next step in my development cycle would be to move onto C++, and build out some extensions!</p>
  
  <p>As I went through some standard "Hello World" like tutorials, everything seems to make sense for the most part. I built a fairly decent tic-tac-toe application, so I figured it was time to start diving into PECL and see how things were working.  What I found however, kind of blows my mind.</p>
  
  <p>Can anyone please explain both the purpose and reasoning to why something like this:</p>
  
  <pre><code>PHP_FUNCTION(helloWorld)
  {
      RETURN_STRING("Hello World");
  }
  </code></pre>
  
  <p>isn't more along the lines of this:</p>
  
  <pre><code>string helloWorld()
  {
      return "Hello World"
  }
  
  PHP_REGISTER_METHOD("helloWorld");
  </code></pre>
  
  <p>I'm not pretending that I know more than the people that created the language, and I'm not trying to stir up any trouble. It just seems (at least from a beginners perspective) that creating a PHP extension isn't anything like writing a C++ program. It's almost a different language completely, aside from some basic syntax rules.</p>
  
  <p>Any help would be appreciated. Just a beginner trying to grow :)</p>