php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42818 $foo = clone(array()); leaks memory
Submitted: 2007-10-01 18:12 UTC Modified: 2007-10-03 09:48 UTC
From: crrodriguez at suse dot de Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2007-10-01 (CVS) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: crrodriguez at suse dot de
New email:
PHP Version: OS:

 

 [2007-10-01 18:12 UTC] crrodriguez at suse dot de
Description:
------------
memory leak with the following code


Reproduce code:
---------------
<?php $foo = clone(array()); ?>


Expected result:
----------------
Fatal Error: Only objects can be cloned

Actual result:
--------------
Warning: __clone method called on non-object in /home/cristian/5.3/clone_test.php on line 3
[Mon Oct  1 14:11:13 2007]  Script:  'clone_test.php'
/home/cristian/5.3/Zend/zend_vm_execute.h(18768) :  Freeing 0x00C3D9A0 (72 bytes), script=clone_test.php
/home/cristian/5.3/Zend/zend_API.c(821) : Actual location (location was relayed)
Last leak repeated 1 time
=== Total 2 memory leaks detected ===


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-03 09:48 UTC] dmitry@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC