ID: 24834 Updated by: [EMAIL PROTECTED] Reported By: vma1 at abv dot bg -Status: Open +Status: Closed Bug Type: Zend Engine 2 problem Operating System: Slackware Linux 9.0 PHP Version: 5CVS-2003-07-28 (dev) New Comment:
I can not reproduce this with latest CVS. Previous Comments: ------------------------------------------------------------------------ [2003-07-28 00:18:29] vma1 at abv dot bg Description: ------------ The following script causes memory corruption when run from the command line like: php -f ./bug.php There are variants of the script that show the bug when run from the web browser, but these scripts are bigger. Even small changes in the sample script hide the bug. Notice that several bytes in the output string get overwritten. Reproduce code: --------------- <? class database { } $a = new database; $b = new database; class broken { public function __construct () { } public function __destruct () { $this->show (array ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "", "", "", "", "", "", "", "", "", "", "", "", "", "" )); } private function show ($values) { $values_string = ""; foreach ($values as $val) { $values_string .= $val; } printf ("%s\n", $values_string); } } $brk = new broken (); ?> Expected result: ---------------- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Actual result: -------------- aaaaaaaaaaaaë˙żaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24834&edit=1