3v4l.org

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

preferences:
31.93 ms | 402 KiB | 5 Q