weird new leak when passing objects (testcase included).

From: Date: Mon, 11 Dec 2000 13:07:50 +0000
Subject: weird new leak when passing objects (testcase included).
Groups: php.dev 
Request: Send a blank email to php-dev+get-40833@lists.php.net to get a copy of this message
hi, just fixed a bug in serialize and found out that it reports leaks which are unrelated to my fix, but have more to do with passing objects to functions. i'm sure it didn't use to do that. coments? tc <? class a { var $a=1; var $b; function __sleep() { return array("a","b"); } } $a = new a; var_dump($a); $b = serialize($a); // serialize uses call_user_function() to call __sleep() in $a /* if the above line reads: $b = serialize(&$a); we get no leak. */ ?> output is: ../../php4/Zend/zend_hash.c(291) : Freeing 0x081D55C4 (37 bytes), script=../sleep.php ../../php4/Zend/zend_hash.c(202) : Freeing 0x0818D3BC (20 bytes), script=../sleep.php ../../php4/Zend/zend_execute.h(188) : Freeing 0x081D5564 (48 bytes), script=../sleep.php ../../php4/Zend/zend_variables.c(150) : Actual location (location was relayed) ../../php4/Zend/zend_execute.h(185) : Freeing 0x081D54CC (12 bytes), script=../sleep.php ../../php4/Zend/zend_compile.c(1603) : Freeing 0x081D4DDC (12 bytes), script=../sleep.php

« previous php.dev (#40833) next »