Re: [PHP4BETA] BUGS

From: Date: Thu, 15 Apr 1999 23:48:00 +0000
Subject: Re: [PHP4BETA] BUGS
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-105@lists.php.net to get a copy of this message
At 12:13 15/04/99 -0400, AsianAvenue.com wrote: > >Log error appeared in: Apache error_log >Message : start-condition stack underflow > >PHP Code to generate it: > ><? > include( "/web/CCI/AA/phpinclude/Database/lib/oracle734.php" ) ; > > echo "This is a test" ; >?> > >It is OBVIOUSLY something that is in our include file. However, this >include file works fine on the current PHP 3.0.7 version. An underflow problem should not have anything to do with 3.0.6->3.0.7 patches, it's coming from the parser. Could you send me that include file? Do you actually have to have that 'echo' statement in there so that the error would occur? >File error appears in: php4/main.c > >Original Code: > if (strcmp(PG(error_log), "syslog")) { > >This looks like the logging bug from 3.0.6.....everything seems to go to >syslog even though I specified a log file in the php3.ini. I changed it >the same way I did 3.0.6 and it worked: > > if (!strcmp(PG(error_log), "syslog")) { Probably a 3.0.6->3.0.7 fix missing from the tree. As Andi mentioned, the php4 alpha tree is based on PHP 3.0.6. >The following works fine: > ><? > echo "Testing" ; >?> > >However, this does not: > ><? > ech "Testing" ; >?> > >And it SHOULD NOT...however, it does not log any messages anywhere. I >suspect this has something to do with dynamic function declaration. >Should it not log a warning or error? It should, provided you have error reporting set to high enough a number (or actually, enough bits). Note that the values for error_reporting have changed from PHP 3.0, since there are now more error types (compile errors, etc.). So if you had your error_reporting set to a small number, you should bump it up to say, 65535 (which should be enough for PHP 4.0 and all future versions we're likely to release in the near future :). If you don't have error_reporting set to anything, then the default which is E_ALL minus notices, should cause that error to be logged (assuming error logging works fine for you otherwise). >If I include a file which does not exist, I am FORCED to check the return >value of include to see if there is an error. PHP 3 will write a log >entry to the error_log to indicate the file could not be found. So will Zend, if you have error_reporting set properly... >The code below is wrong but does not log anything anywhere. > > FUNCTION myFunction( &x, y, z ) > { > $retVal = ARRAY( $x, $y, $z ) ; > > $x = 900 ; > > return( $retVal ) ; > } Hmm, do you mean the missing $ signs? It's a parse error that you're probably again missing for the same reason mentioned above. >The following works in PHP3 and not with Zend: > > FUNCTION myFunction( &$x, $y, $z ) > { > $retVal = ARRAY( $x, $y, $z ) ; > > $x = 900 ; > > return( $retVal ) ; > } > > $a = 1 ; > $b = 2 ; > $c = 3 ; > LIST( $retA, $retB, $retC ) = myFunction( $a, $b, $c ) ; > > echo "$a, $b, $c, $retA, $retB, $retC<BR>" ; > >IN PHP3, this outputs: > >900, 2, 3, 1, 2, 3 > >IN ZEND, this outputs: > >1, 2, 3, 1, 2, 3 It should work now after Andi's patch. In between the time we've sent Zend to PHP's core developers and the time we've sent it to you, we've actually rewritten a fairly large part of the function call code for increased performance (it now uses an optimized pointer stack to pass arguments to functions, instead of hash tables as was the case in php3). PHP4 already runs the PHP web site properly, so while there could still be bugs (as you've found in the pass-by-reference code), most of them should be eliminated already. >Hope these help. They have - thanks, Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il -- PHP 4 Beta

« previous php.version4 (#105) next »