PHP4 Bug #1767: Incompatability with objects?

From: Date: Tue, 20 Jul 1999 20:55:17 +0000
Subject: PHP4 Bug #1767: Incompatability with objects?
Groups: php.dev 
Request: Send a blank email to php-dev+get-8806@lists.php.net to get a copy of this message
From: georgeh@blowtorch.com Operating system: Linux 2.2.10 PHP version: 4.0 Beta 1 PHP Bug Type: Parser error Bug description: Incompatability with objects? I think this is related to bug 1766, but I'm not positive, so I'm entering it separately. Code like this worked in PHP3 and doesn't work in PHP4: function get_MyObject ( $var == "" ) { // stupid 4.0 // initialization // change if ($var == "") { $var = $GLOBALS[MY_ENV_VAR]; }; return new MyObject ($this, $var); } assuming function is a member of a parent class. The parser dies on the "return" line with a parser error. This looks like it may be the same as bug 1766, where it seems you need to assign the object to a temp variable, then return the variable. That's a problem for me, I've got 5k+ lines of PHP script I'd have to dig through to fix this one. :) Not sure if that's really the problem, but it seems to be.

« previous php.dev (#8806) next »