3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $count; public function __construct() { $this->count = 1; } public function addCount() { $this->count++; } } class Bar { private $foo; private $array; public function __construct() { $this->foo = new Foo; $this->array = array(1, 2, 3); } public function getFoo() { return $this->foo; } public function getArray() { return $this->array; } } $bar = new Bar; $foo = $bar->getFoo(); $array = $bar->getArray(); var_dump($bar->getFoo()); print '<br>'; var_dump($foo); print '<br>'; var_dump($bar->getArray()); print '<br>'; var_dump($array); print '<br>'; $foo->addCount(); $array[] = 4; var_dump($bar->getFoo()); print '<br>'; var_dump($foo); print '<br>'; var_dump($bar->getArray()); print '<br>'; var_dump($array); print '<br>';<?php

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.210.0120.04212.40
5.4.200.0120.04012.40
5.4.190.0120.03812.40
5.4.180.0100.03912.39
5.4.170.0110.04212.41
5.4.160.0150.05412.40
5.4.150.0090.04912.40
5.4.140.0120.04112.09
5.4.130.0130.04212.07
5.4.120.0130.04012.03
5.4.110.0110.03812.03
5.4.100.0120.04012.03
5.4.90.0130.03912.03
5.4.80.0210.06112.03
5.4.70.0090.04712.03
5.4.60.0100.04812.02
5.4.50.0100.04612.03
5.4.40.0130.03612.02
5.4.30.0090.04112.01
5.4.20.0120.03612.00
5.4.10.0060.04312.01
5.4.00.0120.04111.50
5.3.270.0100.04312.72
5.3.260.0100.04212.72
5.3.250.0100.04212.72
5.3.240.0150.04512.72
5.3.230.0130.04812.71
5.3.220.0190.07312.68
5.3.210.0110.04612.68
5.3.200.0130.03912.68
5.3.190.0110.04312.68
5.3.180.0100.04212.67
5.3.170.0120.05412.67
5.3.160.0070.04512.67
5.3.150.0140.04512.67
5.3.140.0130.03912.66
5.3.130.0090.04412.66
5.3.120.0120.04312.66
5.3.110.0090.04512.66
5.3.100.0150.03912.13
5.3.90.0120.04112.10
5.3.80.0140.04112.09
5.3.70.0160.08312.09
5.3.60.0140.04412.08
5.3.50.0160.04312.02
5.3.40.0130.04712.02
5.3.30.0120.04111.99
5.3.20.0090.04511.77
5.3.10.0090.04111.73
5.3.00.0180.04911.72

preferences:
139.39 ms | 1394 KiB | 7 Q