3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { public $value; public function __constuct($value) { $this->value = $value; } } $array = []; for($i = 0; $i < 50000; $i++) { $array[] = md5('hallo'); $array[] = md5('bla'); } $x = new x($array); echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.'); echo "\n"; unset($value); unset($x); echo gc_collect_cycles(); echo "\n"; echo number_format(memory_get_usage(), 0, ',', '.'); echo "\n"; echo number_format(memory_get_usage(true), 0, ',', '.');

preferences:
31.12 ms | 402 KiB | 5 Q