[PHP-BUG] Bug #55305 [NEW]: ref lost: 1st ref instantiated in class def, 2nd ref made w/o instantiating
From: yaauie Operating system: ALL PHP version: 5.4SVN-2011-07-27 (SVN) Package: *General Issues Bug Type: Bug Bug description:ref lost: 1st ref instantiated in class def, 2nd ref made w/o instantiating Description: Reference is lost, causing segfault and/or oddities when primary reference is edited after secondary is edited. Occurs only when the variable name is instantiated in the class definition, and the second reference is not instantiated before it is made. Possible workarounds include: Instantiate neither variable name in the class definition Instantiate both variable names in the class definition Instantiate secondary variable name before making it a reference to the first: $this->bar = nil; $this->bar =& $this->foo; The bug is new to 5.4. Test script: --- foo = ''; $this->bar =& $this->foo; } function dump(){ echo 'foo: ';var_dump($this->foo); echo 'bar: ';var_dump($this->bar); } } $f = new Foo(); $f->dump(); $f->foo .= 'foo'; $f->dump(); $f->bar .= 'bar'; $f->dump(); $f->foo .= 'foo'; $f->dump(); ?> Expected result: foo: string(0) "" bar: string(0) "" foo: string(3) "bar" bar: string(3) "bar" foo: string(6) "barfoo" bar: string(6) "barfoo" Actual result: -- varies from platform to platform On Windows: foo: string(0) "" bar: NULL foo: string(3) "foo" bar: NULL foo: UNKNOWN:0 bar: string(3) "bar" CRASH On Linux (Ubuntu 11.04): foo: string(0) "" bar: NULL foo: NULL bar: string(3) "bar" foo: string(3) "foo" bar: string(3) "???" where ?? is 3 seemingly-random bytes. OR, if an additional one-or-three-parameter method is defined in the class (even if it is not called): string(0) "" NULL NULL Segmentation fault If the uncalled method has a different number of arguments, it generates a zend_mm_heap_corrupted instead -- Edit bug report at https://bugs.php.net/bug.php?id=55305&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55305&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55305&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55305&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55305&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55305&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55305&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55305&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55305&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55305&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55305&r=support Expected behavior: https://bugs.php.net/fix.php?id=55305&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55305&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55305&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55305&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55305&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55305&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55305&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55305&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55305&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55305&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55305&r=mysqlcfg
[PHP-BUG] Bug #55541 [NEW]: errors spawn MessageBox, which blocks test automation
From: yaauie Operating system: Win32 PHP version: trunk-SVN-2011-08-30 (snap) Package: Output Control Bug Type: Bug Bug description:errors spawn MessageBox, which blocks test automation Description: Calls to the Win32 API MessageBox block automated testing. When the automation is spawned by a timed script, that script does not have access to the UI to close these messages. 3 places where MessageBox is called: Zend/zend_ini_parser.y:179 - instead of printing an INI parse error to stderr, *always* when PHP_WIN32 is defined. This means that the test suite does not catch the error on Windows machines (example parse error directive `php -n -d foo="a=href"`) and execution of automated tests is blocked until a user can click through. - example main/main.c:984 - in addition to other logging, but only if display_startup_errors is true and the error type is either E_CORE_WARNING or E_CORE_ERROR. - since display_startup_errors is set to true by the testing suite (and is required for many tests to pass), I cannot disable it. Perhaps a new ini directive should be created instead of having this one overloaded? sapi/cgi/cgi_main.c:1768 - only when PHP_DEBUG is defined. I don't have a big problem with this, since it is debug code, but perhaps it too could be governed by an ini directive. Test script: --- pass a deliberately-defective ini directive: `php -n -d a=b=c -v` Expected result: --STDERR-- php: syntax error, unexpected '=' in Unknown on line 7 --STDOUT-- PHP 5.5.0-dev (cli) (built: Aug 30 2011 18:14:14) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies Actual result: -- --BLOCKING-MESSAGEBOX-- --- PHP Error --- syntax error, unexpected '=' in Unknown on line 7 --- OK --- --STDERR--(nothing) --STDOUT-- PHP 5.5.0-dev (cli) (built: Aug 30 2011 18:14:14) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies -- Edit bug report at https://bugs.php.net/bug.php?id=55541&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55541&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55541&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55541&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55541&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55541&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55541&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55541&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55541&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55541&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55541&r=support Expected behavior: https://bugs.php.net/fix.php?id=55541&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55541&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55541&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55541&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55541&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55541&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55541&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55541&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55541&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55541&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55541&r=mysqlcfg
[PHP-BUG] Bug #55648 [NEW]: CLI: the ini directives passed with -d to the CLI do not parse constants.
From: yaauie Operating system: Windows 7 PHP version: 5.4SVN-2011-09-06 (snap) Package: CGI/CLI related Bug Type: Bug Bug description:CLI: the ini directives passed with -d to the CLI do not parse constants. Description: In posix-based systems, you can set error_reporting from the command line using the constants, but on Windows this always fails and results in an error_reporting() value of zero. This affects test automation, where these directives may be supplied in the INI section of a phpt test case. run-tests.php runs these tests by passing their ini- directives as -d. While run-tests.php explicitly sets the numeric value of these constants in the base ini, they do not get explicitly set in phpt-specific overrides. Thus, output may be different than expected. Test script: --- php.exe -n -d "error_reporting=E_ALL" -r "var_dump(error_reporting());" Expected result: int(32767) # or similar Actual result: -- int(0) -- Edit bug report at https://bugs.php.net/bug.php?id=55648&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55648&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55648&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55648&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55648&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55648&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55648&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55648&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55648&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55648&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55648&r=support Expected behavior: https://bugs.php.net/fix.php?id=55648&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55648&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55648&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55648&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55648&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55648&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55648&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55648&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55648&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55648&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55648&r=mysqlcfg