differences between PHP3 and PHP4

From: Date: Sat, 14 Oct 2000 07:54:48 +0000
Subject: differences between PHP3 and PHP4
Groups: php.general 
Request: Send a blank email to php-general+get-20132@lists.php.net to get a copy of this message
Hi php-general, I found the differences between PHP3 and PHP4. If these are known issues, ignore them. But they are not found in http://www.php.net/version4/incompatibilities.php Thanks a lot. ----- (1) In ver.3, a function must be defined in the step prior to the calling point. e.g. function aaa (){ bbb(); # resuls in syntax error in ver3;"hey!!" in ver4. } function bbb(){ echo "hey!!"; } ------ (2) In ver4, The scope of a constant defined in a member-function can be reached from other member-functions in the same class , unlike ver3. e.g. class Foo{ function aaa(){ define("LUCKY_NUMBER",777); } function bbb(){ echo LUCKY_NUMBER; } } $foo = new Foo; # $foo = new Foo; is error in ver3 also $foo->aaa(); $foo->bbb(); # echoes "777" in ver4; "LUCKY_NUMBER" in ver3 ------ (3) isSet([an uninitialized instance var.]) returns false in ver 4; true in ver3 e.g class Entity{ var $db; function check_db(){ if(!isSet($this->db)){ $this->db = new MyDB; # never executed in ver3 } } } --- (4) class name is case-sensitive in ver4, unlike ver3 ------ Mr. Ashida, Naoyuki Aurora Systems, Inc., Japan

« previous php.general (#20132) next »