3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace My\Example\Model { abstract class Super { private $aliases; protected function __construct(array $aliases) { $this->aliases = $aliases; } public function __call($name, $arguments) { echo "Calling virtual method $name...\n"; /* if $name is an alias, replace it */ if (isset($this->aliases[$name])) { $name = $this->aliases[$name]; echo "That's an alias for $name...\n"; } /* throw an exception if the method is undefined */ if (!method_exists($this, $name)) { throw new Exception("The specified method or method alias is undefined in the current context"); } /* finally, call the method by its actual name */ return $this->$name($arguments); } } namespace My\Example\Model { class Sub extends Super { public function __construct() { parent::__construct(array( "alias" => "actualMethod" )); } public function actualMethod() { echo "Inside the actual method\n"; } } } namespace My\Example { $sub = new Sub; $sub->alias(); }

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.220.0110.04312.39
5.4.210.0100.04512.39
5.4.200.0120.04112.39
5.4.190.0120.04112.39
5.4.180.0120.03912.38
5.4.170.0100.04612.40
5.4.160.0150.03712.39
5.4.150.0130.04512.39
5.4.140.0090.04612.07
5.4.130.0150.03812.06
5.4.120.0100.04312.02
5.4.110.0100.04612.02
5.4.100.0140.04212.01
5.4.90.0100.04312.01
5.4.80.0110.04112.01
5.4.70.0120.03912.01
5.4.60.0110.04112.01
5.4.50.0150.03812.01
5.4.40.0120.04111.99
5.4.30.0130.04211.99
5.4.20.0130.04311.99
5.4.10.0120.04111.99
5.4.00.0090.04411.48
5.3.270.0120.04312.72
5.3.260.0140.04312.72
5.3.250.0130.04312.72
5.3.240.0130.04212.72
5.3.230.0110.04612.71
5.3.220.0140.04712.68
5.3.210.0130.04212.68
5.3.200.0120.04612.68
5.3.190.0110.04612.68
5.3.180.0130.04512.67
5.3.170.0120.04512.67
5.3.160.0120.04412.67
5.3.150.0120.04612.67
5.3.140.0120.04312.66
5.3.130.0150.04512.66
5.3.120.0090.05012.66
5.3.110.0160.04612.66
5.3.100.0180.04212.12
5.3.90.0140.04312.10
5.3.80.0120.04412.08
5.3.70.0150.04312.08
5.3.60.0110.04912.07
5.3.50.0140.04112.02
5.3.40.0110.04512.02
5.3.30.0100.04111.98
5.3.20.0160.03611.76
5.3.10.0130.03911.72
5.3.00.0120.04511.71

preferences:
145.79 ms | 1394 KiB | 7 Q