3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $id; public function __set($key, $value) { if (isset($this->$key)) $this->$key = $value; // throw new Exception() could be added here } public function __get($key) { return isset($this->$key) ? $this->$key : null; } public function __call($name, $arguments) { $matches = array(); $pattern = '/^set([A-Za-z0-9]+)/'; if (preg_match($pattern, $name, &$matches)) { var_dump($arguments, $matches); //$this-> } } } $test = new Test; $test->setId(25);

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.130.0220.04512.05
5.4.120.0210.05211.99
5.4.110.0190.03911.99
5.4.100.0180.04311.99
5.4.90.0180.04211.99
5.4.80.0190.04211.99
5.4.70.0160.04311.99
5.4.60.0220.06611.99
5.4.50.0150.04111.99
5.4.40.0180.05611.97
5.4.30.0200.04111.97
5.4.20.0160.04311.97
5.4.10.0170.07111.97
5.4.00.0150.04211.47
5.3.290.0060.04012.80
5.3.280.0070.04312.71
5.3.270.0080.03912.72
5.3.260.0200.04312.72
5.3.250.0080.03712.72
5.3.240.0310.06212.72
5.3.230.0240.04212.71
5.3.220.0240.06912.68
5.3.210.0180.04312.68
5.3.200.0220.07012.68
5.3.190.0190.04312.67
5.3.180.0150.04612.67
5.3.170.0300.07812.67
5.3.160.0200.04212.67
5.3.150.0270.06412.67
5.3.140.0180.04312.66
5.3.130.0250.06812.66
5.3.120.0180.04512.66
5.3.110.0180.04412.66
5.3.100.0170.04412.12
5.3.90.0200.04312.10
5.3.80.0140.04812.09
5.3.70.0200.05612.09
5.3.60.0210.04212.07
5.3.50.0160.04612.02
5.3.40.0190.04512.01
5.3.30.0180.04111.98
5.3.20.0230.06711.76
5.3.10.0360.06911.72
5.3.00.0160.04311.71

preferences:
143.25 ms | 1394 KiB | 7 Q