source: src/router/php7/Zend/tests/bug71818.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 4 months ago

update php

File size: 443 bytes
Line 
1--TEST--
2Bug #71818 (Memory leak when array altered in destructor)
3--INI--
4zend.enable_gc = 1
5--FILE--
6<?php
7class MemoryLeak
8{
9    public function __construct()
10    {
11        $this->things[] = $this;
12    }
13
14    public function __destruct()
15    {
16        $this->things[] = null;
17    }
18
19    private $things = [];
20}
21
22ini_set('memory_limit', '10M');
23
24for ($i = 0; $i < 100000; ++$i) {
25    $obj = new MemoryLeak();
26}
27echo "OK\n";
28?>
29--EXPECT--
30OK
Note: See TracBrowser for help on using the repository browser.