3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractClass { abstract function __construct() { } // Our abstract method only needs to define the required arguments abstract protected function prefixName($name); } class ConcreteClass extends AbstractClass { public function __construct($a) { echo $a; } // Our child class may define optional arguments not in the parent's signature public function prefixName($name, $separator=0 ) { if ($name == "Pacman") { $prefix = "Mr"; } elseif ($name == "Pacwoman") { $prefix = "Mrs"; } else { $prefix = ""; } return "{$prefix}{$separator} {$name}"; } } $class = new ConcreteClass(666699990000); echo $class->prefixName("Pacman"), "\n"; echo $class->prefixName("Pacwoman"), "\n"; ?>

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.0150.05412.38
5.4.210.0130.04512.38
5.4.200.0110.04912.38
5.4.190.0130.04212.38
5.4.180.0120.04312.38
5.4.170.0110.04212.39
5.4.160.0180.05212.38
5.4.150.0110.04112.38
5.4.140.0130.03912.06
5.4.130.0160.03712.05
5.4.120.0150.05112.01
5.4.110.0110.04912.00
5.4.100.0160.04112.00
5.4.90.0100.04312.00
5.4.80.0130.03712.01
5.4.70.0100.03912.00
5.4.60.0100.04212.00
5.4.50.0110.04212.00
5.4.40.0180.05311.99
5.4.30.0140.04011.99
5.4.20.0130.04411.99
5.4.10.0100.04511.98
5.4.00.0130.04311.48
5.3.270.0150.04912.72
5.3.260.0130.04312.72
5.3.250.0240.04912.72
5.3.240.0170.04512.72
5.3.230.0190.04612.71
5.3.220.0130.04912.68
5.3.210.0190.06312.68
5.3.200.0120.04312.68
5.3.190.0100.04312.68
5.3.180.0130.04312.67
5.3.170.0130.04512.67
5.3.160.0130.04712.67
5.3.150.0140.04012.67
5.3.140.0150.04412.66
5.3.130.0230.06512.66
5.3.120.0160.04312.65
5.3.110.0140.03912.66
5.3.100.0130.04212.12
5.3.90.0120.05612.09
5.3.80.0170.05612.09
5.3.70.0180.03912.08
5.3.60.0160.03812.07
5.3.50.0110.04212.01
5.3.40.0110.04212.01
5.3.30.0150.03711.97
5.3.20.0140.04211.75
5.3.10.0120.04511.71
5.3.00.0120.04611.70

preferences:
140.6 ms | 1386 KiB | 7 Q