3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct() { $this->bar = new Bar($this); } } class Bar { function __construct($foo = null) { $this->foo = $foo; } } $usage = 0; $maxima = array(); while (count($maxima) < 5 && $usage < 50000000) { $foo = new Foo(); unset($foo); $last = $usage; $usage = memory_get_usage(); if ($usage < $last) { $maxima[] = $last; } } if (count($maxima)) { printf("Not buggy: Maxima: %s\n", implode('; ', $maxima)); } else { printf("Buggy! Memory never went down."); } ?>
Output for 7.3.0 - 7.3.1
Not buggy: Maxima: 4672632; 4672176; 4672176; 4672176; 4672176
Output for 7.2.0 - 7.2.13
Not buggy: Maxima: 4668760; 4669136; 4669136; 4669136; 4669136
Output for 7.1.0 - 7.1.25
Not buggy: Maxima: 4631496; 4632704; 4632704; 4632704; 4632704
Output for 7.0.0 - 7.0.32
Not buggy: Maxima: 4631576; 4632728; 4632728; 4632728; 4632728
Output for 5.6.0 - 5.6.38
Not buggy: Maxima: 4726064; 4726296; 4726424; 4726536; 4726696
Output for 5.5.0 - 5.5.38
Not buggy: Maxima: 4726016; 4726216; 4726432; 4726552; 4726744
Output for 5.4.0 - 5.4.45
Not buggy: Maxima: 4726528; 4726720; 4726928; 4727104; 4727264
Output for 5.3.11 - 5.3.29
Not buggy: Maxima: 5130344; 5131200; 5131352; 5131480; 5131664
Output for 5.3.0 - 5.3.10
Not buggy: Maxima: 5130032; 5130960; 5131048; 5131280; 5131376
Output for 5.2.1 - 5.2.17
Buggy! Memory never went down.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/UZNTc on line 23
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/UZNTc on line 23
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/UZNTc on line 23
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/UZNTc on line 23

preferences:
213.99 ms | 401 KiB | 287 Q