3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Intercept { protected $class = null; protected $callback = null; public function __construct($class, $callback = null) { $this->class = new $class(); $this->callback = $callback; } protected function run_callback() { {$this->callback}(); } public function __get($name) { $this->run_callback(); return $this->class->$name; } public function __set($name, $value) { $this->run_callback(); return $this->class->$name = $value; } public function __isset($name) { $this->run_callback(); return isset($this->class->$name); } public function __unset($name) { $this->run_callback(); unset($this->class->$name); } public function __call($method, $args) { $this->run_callback(); return call_user_func_array(array($this->class, $method), $args); } public function __toString() { $this->run_callback(); return $this->class; } public function __invoke() { $this->run_callback(); return $this->class(); } } class test { public function hello() { return 'world'; } } $closure = function() { echo 123; }; $test=new Intercept('test', $closure); echo $test->hello();

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.110.0090.03812.03
5.4.100.0130.04712.03
5.4.90.0100.03912.02
5.4.80.0170.04712.03
5.4.70.0080.04012.02
5.4.60.0100.03812.02
5.4.50.0100.03912.02
5.4.40.0080.03912.01
5.4.30.0090.03912.01
5.4.20.0150.05412.00
5.4.10.0100.03712.01
5.4.00.0100.04411.50
5.3.210.0100.04412.68
5.3.200.0110.03912.68
5.3.190.0120.04912.68
5.3.180.0110.03712.67
5.3.170.0100.04012.67
5.3.160.0130.03812.67
5.3.150.0100.05112.67
5.3.140.0110.04112.66
5.3.130.0140.04212.66
5.3.120.0090.04312.66
5.3.110.0090.04112.66
5.3.100.0090.04112.12
5.3.90.0130.05012.10
5.3.80.0090.04412.09
5.3.70.0100.04012.09
5.3.60.0090.04112.08
5.3.50.0120.03712.03
5.3.40.0100.03912.02
5.3.30.0100.03711.99
5.3.20.0110.04111.77
5.3.10.0090.04311.73
5.3.00.0110.04211.72

preferences:
134.52 ms | 1394 KiB | 7 Q