|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-11-27 13:20 UTC] silicid at gmailc dot om
[2018-11-27 13:39 UTC] danack@php.net
-Status: Open
+Status: Feedback
[2018-11-27 13:39 UTC] danack@php.net
[2018-11-27 14:05 UTC] silicid at gmailc dot om
[2018-12-09 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Description: ------------ You must create a file with the specified code. If you execute method "is_object" from "$this" and unset the object, then leaks memory. But if you call method "is_object" for "$object", then there are no problems. In version 7.1 there are no problems. There are no problems in Windows. Test script: --------------- <?php class Test { public function __construct() { for ($i = 0; $i < 1000; ++$i) { $this->result[] = rand(1, 1000); } } function object() { is_object($this); } } $memory = memory_get_usage(); for ($i = 0; $i < 1; ++$i) { $object = new Test(); $object->object(); unset($object); } var_dump(memory_get_usage() - $memory); $memory = memory_get_usage(); for ($i = 0; $i < 100; ++$i) { $object = new Test(); $object->object(); unset($object); } var_dump(memory_get_usage() - $memory); $memory = memory_get_usage(); for ($i = 0; $i < 100; ++$i) { $object = new Test(); is_object($object); unset($object); } var_dump(memory_get_usage() - $memory); Expected result: ---------------- int(0) int(0) int(0) Actual result: -------------- int(37336) int(3733600) int(0)