Bug #69201 [Opn->Csd]: Memory leak using iterator and get by reference on PHP 7
Edit report at https://bugs.php.net/bug.php?id=69201&edit=1
ID: 69201
Updated by: laruence@php.net
Reported by: jrbasso at gmail dot com
Summary: Memory leak using iterator and get by reference on
PHP 7
-Status: Open
+Status: Closed
Type: Bug
Package: SPL related
Operating System: Any
PHP Version: master-Git-2015-03-08 (Git)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5aebdc98dea1f15993c21eefa25f83383b6e2389
Log: Fixed bug #69201 (Memory leak using iterator and get by reference on PHP 7)
Previous Comments:
------------------------------------------------------------------------
[2015-03-08 04:36:42] jrbasso at gmail dot com
Description:
------------
Compiling PHP in debug mode and running the code from http://3v4l.org/pb3a2 shows a memory leak at the end. It
doesn't happen on stable versions of PHP 5.6.
This get worst when the returned value is a string, as you can see on http://3v4l.org/S3fTZ. If you check the results you will see
&string(1747940472) instead of string(11) like the other versions.
Depending the functions you use after this you get the warning about the string not-zero terminated.
Expected result:
----------------
object(Entity)#1 (1) {
["_properties":protected]=>
array(1) {
["foo"]=>
string(6) " world"
}
}
Actual result:
--------------
object(Entity)#1 (1) {
["_properties":protected]=>
array(1) {
["foo"]=>
string(6) " world"
}
}
[Sun Mar 8 03:59:48 2015] Script: '/home/vagrant/shared/test2.php'
/home/vagrant/shared/php-src/Zend/zend_vm_execute.h(24234) : Freeing 0x7FFAD80751C0 (24 bytes),
script=/home/vagrant/shared/test2.php
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69201&edit=1
Thread (2 messages)