From: justmanj at msu dot edu
Operating system: winxp
PHP version: 5.0.2
PHP Bug Type: Zend Engine 2 problem
Bug description: zend.ze1_compatibility_mode isnt fully compatable with array_push()
Description:
------------
zend.ze1_compatibility_mode when turned on doesn't honor the same
methodlogy as 4.x when passing a class for some parameters - it passes by
reference in functions like array_push();
this behavior was not in 4.3.x, and the only workaround is the clone
keyword, which should be added in the 4.3.x tree for backwards
compatability.
Reproduce code:
---------------
<?
class x { };
$first = new x;
$second = $first;
$container = array();
array_push($container, $first);
$first->first = " im in the first";
print_r($first);
print_r($second);
print_r($container);
Expected result:
----------------
x Object
(
[first] => im in the first
)
x Object
(
)
Array
(
[0] => x Object
(
)
)
Actual result:
--------------
x Object
(
[first] => im in the first
)
x Object
(
)
Array
(
[0] => x Object
(
[first] => im in the first
)
)
--
Edit bug report at http://bugs.php.net/?id=30332&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30332&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30332&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30332&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30332&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30332&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30332&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30332&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30332&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30332&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30332&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30332&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30332&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30332&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30332&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30332&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30332&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30332&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30332&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30332&r=mysqlcfg