#26059 [Opn->Ver]: Call to __set() crashes Apache when setting array element!
by other posts by this author
Oct 31 2003 9:59PM messages near this date
#26059 [Ver->Csd]: Call to __set() crashes when setting array element
|
[PHP-DEV] CVS Account Request: mcgyver5
ID: 26059
Updated by: iliaa@[...].net
Reported By: myle34 at hotmail dot com
-Status: Open
+Status: Verified
Bug Type: Reproducible crash
-Operating System: Windows XP
+Operating System: All
PHP Version: 5CVS-2003-10-31 (dev)
Previous Comments:
------------------------------------------------------------------------
[2003-10-31 12:41:29] myle34 at hotmail dot com
Description:
------------
I am using PHP5-b2 and Apache 2.0.47 with Windows XP. Apache crashes
when the below code is run.
Reproduce code:
---------------
class Foo {
private $bar = array();
function __get($var) {
return(isset($this-> bar[$var]) ? $this->bar[$var] : NULL);
}
function __set($var,$val) {
$this-> bar[$var] = $val;
}
}
$foo = new Foo();
// Works
// $foo-> test = array('testing'=>'testing, 1...2...3...');
// Doesn't work, crashes Apache
$foo-> test = array();
$foo-> test['testing'] = 'testing, 1...2...3...';
print_r($foo-> test);
Expected result:
----------------
Array
(
[testing] => testing, 1...2...3...
)
Actual result:
--------------
Apache crashes! No output.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26059&edit=1
Thread:
myle34 at hotmail dot com
|