Something might wrong in 'language.oop.constructor.php'?

From: Date: Sat, 08 Mar 2003 08:47:14 +0000
Subject: Something might wrong in 'language.oop.constructor.php'?
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352134@lists.php.net to get a copy of this message
I'm not sure if it is the result it supposed to be, but on page: http://www.php.net/manual/en/language.oop.constructor.php The 4th example makes no difference when running under PHP3 and PHP4. The example is to demostrate constructor: class A { function A() { echo "I am the constructor of A.<br>\n"; } function B() { echo "I am a regular function named B in class A.<br>\n"; echo "I am not a constructor in A.<br>\n"; } } class B extends A { function C() { echo "I am a regular function.<br>\n"; } } // This will call B() as a constructor. $b = new B;And the result is (Under Windows): D:\TEMP>\php3\php.exe class.php X-Powered-By: PHP/3.0.17 Content-type: text/html I am a regular function named B in class A.<br> I am not a constructor in A.<br> D:\TEMP>\php4.3\php.exe class.php Content-type: text/html X-Powered-By: PHP/4.3.1 I am a regular function named B in class A.<br> I am not a constructor in A.<br> D:\TEMP>\php5\php.exe class.php Content-type: text/html X-Powered-By: PHP/5.0.0-dev I am the constructor of A.<br> Is there something wrong here? Thanks!

« previous php.doc (#969352134) next »