#26900 [Ver->Csd]: Memory leak when passing arguments to __clone()

From: Date: Thu, 05 Feb 2004 01:02:55 +0000
Subject: #26900 [Ver->Csd]: Memory leak when passing arguments to __clone()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54423@lists.php.net to get a copy of this message
ID: 26900 Updated by: helly@php.net Reported By: adam at trachtenberg dot com -Status: Verified +Status: Closed Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS-2004-01-26 New Comment: __clone cannot be callled directly any longer and when using the new clone keyword you cannot pass parameters. Previous Comments: ------------------------------------------------------------------------ [2004-01-13 18:38:07] adam at trachtenberg dot com Description: ------------ Passing arguments to __clone() causes a memory leak. (I know this is invalid.) Reproduce code: --------------- class foo { function __clone() {} } $a = new foo; $b = $a->__clone('bad argument'); Expected result: ---------------- No leaks. Actual result: -------------- PHP Warning: Clone method does not require arguments in /Users/adam/php5/clone.php on line 8 /usr/local/cvs/php/php-src/Zend/zend_execute.c(2817) : Freeing 0x00B98C30 (16 bytes), script=./clone.php /usr/local/cvs/php/php-src/Zend/zend_execute.c(2820) : Freeing 0x00B98AD0 (13 bytes), script=./clone.php /usr/local/cvs/php/php-src/Zend/zend_variables.c(137) : Actual location (location was relayed) === Total 2 memory leaks detected === ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26900&edit=1

« previous php.bugs (#54423) next »