All,

I came across the following inconsistency between PHP 4 and PHP 5 Build
2195(Jul 24 2003 20:10:21). The error makes sense. I am just curious
about the version inconsistency. Is this due to a change in PHP 5 (as part
of the class enhancements) or is it an oversight?
For my information, please advise.


==Example==
I can initiate a class before it is defined in version 4, but not in 5.


<?
 //filename.php

 //you can initiate the class before it is defined
 $page = new PageClass;

  class PageClass{  blah...blah...blah...;  }

?>
 will work in PHP 4, but will generate an 'Underfine Class' error in PHP 5.

 In PHP 5, the above must be written as

 <?
  //class must be defined first
  class ClassName {    blah...blah...; }

  //class must be defined before it is initiated
  $page = new ClassName;
?>


This error makes sense, as you cannot use something that doesn't exist.
I'm mostly curious about the inconsistency between the two versions.

This is not a big issue, but I am curious? Any comments?

-john


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to