3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface iPropulsion { public function accelerate(); public function decelerate(); } interface iOrdonance { public function lockOn(); public function fire(); } class CarEngine implements iPropulsion { public function accelerate() { return "increase revs to 3000... This should shake yer kidney stones..."; } public function decelerate() { return "decrease revs to 1000"; } } class JetEngine implements iPropulsion { public function accelerate() { return "increase revs to 20000... To the ends of skies..."; } public function decelerate() { return "decrease revs to 5000"; } } class Cannon implements iOrdonance { public function lockOn() { return "Srsly?! Just point and shoot, how hard is that..."; } public function Fire() { return "Dagagagagaga!"; } } class Rocket implements iOrdonance { public function lockOn() { return "Beep... Beep... Beeeeeeeeeeeep..."; } public function Fire() { return "Swhooosh! Ka-Boom!"; } } class Vehicle { private $propulsion = null; private $ordonance = null; public function __construct(iPropulsion $propulsion, iOrdonance $ordonance) { $this->propulsion = $propulsion; $this->ordonance = $ordonance; } public function start() { print $this->propulsion->accelerate() . PHP_EOL; } public function stop() { print $this->propulsion->decelerate() . PHP_EOL; } public function lockOn() { print $this->ordonance->lockOn() . PHP_EOL; } public function fire() { print $this->ordonance->fire() . PHP_EOL; } public function setPropulsion(iPropulsion $propulsion) { $this->propulsion = $propulsion; } public function setOrdonance(iOrdonance $ordonance) { $this->ordonance = $ordonance; } } print "Hey I want a new fighting vehicle... With a Cannon!" . PHP_EOL; $fighter = new Vehicle(new CarEngine(), new Cannon()); print "Peel off" . PHP_EOL; $fighter->start(); print "Hey I want some target practice :)" . PHP_EOL; print "Going to lock on the target" . PHP_EOL; $fighter->lockOn(); print "Time to blow stuff up" . PHP_EOL; $fighter->fire(); print "This sux, moving too slow :(" . PHP_EOL; $fighter->stop(); print "I need a better engine, mekkaniku-san, and rockets, lotsalotsa rockets, kthxbai" . PHP_EOL; $fighter->setPropulsion(new JetEngine()); $fighter->setOrdonance(new Rocket()); print "Once again into the fray" . PHP_EOL; $fighter->start(); print "Going to lock on the target, hopefully this will go better than last time" . PHP_EOL; $fighter->lockOn(); print "Yeeehaw" . PHP_EOL; $fighter->fire(); print "Control, one bogey down" . PHP_EOL;

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)
8.3.60.0040.01116.50
8.3.50.0100.00922.89
8.3.40.0120.00318.89
8.3.30.0100.00319.10
8.3.20.0000.00820.35
8.3.10.0050.00323.58
8.3.00.0030.00719.38
8.2.180.0060.00916.50
8.2.170.0070.00722.96
8.2.160.0000.01520.57
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0080.01126.16
8.2.120.0000.00821.01
8.2.110.0090.00022.11
8.2.100.0060.00618.22
8.2.90.0060.00319.19
8.2.80.0090.00017.97
8.2.70.0040.00417.63
8.2.60.0040.00418.03
8.2.50.0080.00018.07
8.2.40.0030.00618.09
8.2.30.0000.00717.96
8.2.20.0000.00717.77
8.2.10.0090.00018.14
8.2.00.0040.00417.59
8.1.280.0070.00725.92
8.1.270.0040.00423.83
8.1.260.0040.00426.35
8.1.250.0110.00428.09
8.1.240.0090.00022.07
8.1.230.0060.00619.09
8.1.220.0050.00317.74
8.1.210.0090.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.25
8.1.180.0080.00018.10
8.1.170.0000.00918.71
8.1.160.0000.00722.04
8.1.150.0050.00218.80
8.1.140.0000.00717.48
8.1.130.0000.00717.86
8.1.120.0070.00017.44
8.1.110.0040.00417.32
8.1.100.0030.00517.43
8.1.90.0050.00217.34
8.1.80.0050.00517.49
8.1.70.0070.00017.43
8.1.60.0090.00017.65
8.1.50.0040.00417.52
8.1.40.0080.00017.45
8.1.30.0060.00317.69
8.1.20.0070.00017.63
8.1.10.0000.00817.60
8.1.00.0030.00617.43
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.41
8.0.270.0020.00517.37
8.0.260.0060.00017.29
8.0.250.0030.00317.10
8.0.240.0030.00617.09
8.0.230.0100.00017.04
8.0.220.0000.00717.02
8.0.210.0030.00317.04
8.0.200.0000.00716.98
8.0.190.0000.00716.96
8.0.180.0070.00017.03
8.0.170.0030.00517.00
8.0.160.0040.00417.07
8.0.150.0040.00416.93
8.0.140.0050.00516.91
8.0.130.0030.00313.44
8.0.120.0030.00516.88
8.0.110.0000.00916.91
8.0.100.0000.00716.82
8.0.90.0000.00716.98
8.0.80.0140.00816.86
8.0.70.0050.00316.85
8.0.60.0060.00316.90
8.0.50.0000.00716.96
8.0.30.0090.01017.26
8.0.20.0090.01217.40
8.0.10.0000.00717.13
8.0.00.0090.01117.02
7.4.330.0000.00715.00
7.4.320.0000.00616.57
7.4.300.0060.00016.52
7.4.290.0030.00316.46
7.4.280.0000.00716.63
7.4.270.0040.00416.55
7.4.260.0000.00816.63
7.4.250.0000.00816.43
7.4.240.0040.00416.51
7.4.230.0050.00316.66
7.4.220.0160.01316.54
7.4.210.0000.01416.70
7.4.200.0000.00716.34
7.4.160.0110.00616.43
7.4.150.0140.00617.40
7.4.140.0080.01017.86
7.4.130.0060.01616.67
7.4.120.0140.00916.51
7.4.110.0090.00916.52
7.4.100.0100.00716.38
7.4.90.0100.00716.71
7.4.80.0060.01619.39
7.4.70.0100.00716.51
7.4.60.0090.01316.53
7.4.50.0000.00916.15
7.4.40.0170.00316.32
7.4.30.0030.01316.29
7.4.00.0100.00715.09
7.3.330.0000.00513.25
7.3.320.0000.00813.36
7.3.310.0070.00016.40
7.3.300.0030.00316.36
7.3.290.0090.00616.27
7.3.280.0090.00916.37
7.3.270.0080.01117.40
7.3.260.0070.01016.31
7.3.240.0030.01416.35
7.3.230.0140.00316.39
7.3.210.0120.00616.34
7.3.200.0070.01019.39
7.3.190.0140.00316.37
7.3.180.0110.00516.51
7.3.170.0080.00816.43
7.3.160.0100.00716.32
7.2.330.0070.01416.41
7.2.320.0130.01016.78
7.2.310.0080.01116.55
7.2.300.0080.00816.54
7.2.290.0090.01516.98
7.2.60.0070.00716.84
7.2.00.0060.00919.14
7.1.200.0030.00615.41
7.1.100.0030.00618.27
7.1.70.0030.00317.03
7.1.60.0100.01019.40
7.1.50.0110.01416.84
7.1.00.0070.07322.54
7.0.200.0050.00516.53
7.0.140.0030.06722.06
7.0.110.0100.07719.99
7.0.100.0100.07720.01
7.0.90.0070.08720.09
7.0.80.0230.05319.96
7.0.70.0100.07320.10
7.0.60.0030.08719.95
7.0.50.0130.08020.04
7.0.40.0000.07319.65
7.0.30.0070.07719.77
7.0.20.0130.07319.78
7.0.10.0070.09019.75
7.0.00.0070.06319.82
5.6.280.0030.07321.11
5.6.260.0070.08020.79
5.6.250.0030.08720.74
5.6.240.0070.08020.72
5.6.230.0100.08020.68
5.6.220.0100.08020.75
5.6.210.0170.07320.69
5.6.200.0070.08720.63
5.6.190.0100.07720.61
5.6.180.0170.07020.74
5.6.170.0030.08020.61
5.6.160.0100.07720.59
5.6.150.0130.07720.63
5.6.140.0070.08020.66
5.6.130.0200.06720.68
5.6.120.0100.07720.89
5.6.110.0070.06320.67
5.6.100.0070.09020.58
5.6.90.0070.05720.57
5.6.80.0100.07320.04
5.6.70.0170.06320.02
5.6.60.0100.07720.05
5.6.50.0070.07320.07
5.6.40.0100.08019.96
5.6.30.0000.08320.04
5.6.20.0130.07019.96
5.6.10.0170.03019.98
5.6.00.0000.04320.02
5.5.380.0070.08017.59
5.5.370.0070.08017.46
5.5.360.0070.07717.68
5.5.350.0100.08017.67
5.5.340.0130.07718.22
5.5.330.0230.06017.96
5.5.320.0070.07717.86
5.5.310.0070.08018.25
5.5.300.0070.08018.13
5.5.290.0100.04318.09
5.5.280.0130.07318.05
5.5.270.0030.04318.16
5.5.260.0100.08018.08
5.5.250.0070.08317.96
5.5.240.0130.07317.48
5.5.230.0100.08317.43
5.5.220.0130.06317.43
5.5.210.0070.07717.48
5.5.200.0130.06717.61
5.5.190.0030.08017.46
5.5.180.0100.04317.34
5.5.160.0200.06717.30
5.5.150.0130.07017.43
5.5.140.0030.08017.29
5.5.130.0100.06717.45
5.5.120.0000.07317.60
5.5.110.0100.08017.20
5.5.100.0130.07017.38
5.5.90.0170.06017.11
5.5.80.0170.06717.38
5.5.70.0100.07717.23
5.5.60.0070.08017.46
5.5.50.0070.07717.19
5.5.40.0030.08317.22
5.5.30.0100.08017.39
5.5.20.0100.07717.15
5.5.10.0100.07317.19
5.5.00.0070.07317.17
5.4.450.0070.08319.56
5.4.440.0100.07719.30
5.4.430.0030.07719.63
5.4.420.0070.07319.41
5.4.410.0100.07319.29
5.4.400.0100.07719.23
5.4.390.0100.07718.95
5.4.380.0030.05319.23
5.4.370.0070.07719.01
5.4.360.0030.06719.02
5.4.350.0100.07019.18
5.4.340.0070.07319.00
5.4.320.0030.08019.24
5.4.310.0130.07318.99
5.4.300.0100.08019.02
5.4.290.0000.08319.33
5.4.280.0030.08319.02
5.4.270.0030.08019.00
5.4.260.0070.07719.30
5.4.250.0070.07719.18
5.4.240.0170.06719.32
5.4.230.0130.06719.13
5.4.220.0070.07318.96
5.4.210.0130.07019.36
5.4.200.0000.08319.33
5.4.190.0130.05719.30
5.4.180.0070.07319.23
5.4.170.0200.06719.25
5.4.160.0030.07719.22
5.4.150.0070.06019.07
5.4.140.0070.08016.45
5.4.130.0030.08016.39
5.4.120.0130.06016.55
5.4.110.0070.07016.61
5.4.100.0070.07016.71
5.4.90.0030.07316.48
5.4.80.0030.06716.54
5.4.70.0170.06716.30
5.4.60.0100.06316.57
5.4.50.0030.07716.50
5.4.40.0130.06716.50
5.4.30.0130.06316.57
5.4.20.0100.06716.28
5.4.10.0070.07016.36
5.4.00.0100.07315.85
5.3.290.0030.08314.71
5.3.280.0100.05714.64
5.3.270.0070.07314.62
5.3.260.0130.06014.77
5.3.250.0100.04014.72
5.3.240.0170.06314.62
5.3.230.0070.07014.78
5.3.220.0070.09714.60
5.3.210.0030.07714.62
5.3.200.0030.07314.75
5.3.190.0030.08014.69
5.3.180.0030.07714.46
5.3.170.0130.07014.63
5.3.160.0030.07714.69
5.3.150.0100.07314.61
5.3.140.0130.06714.71
5.3.130.0100.07714.61
5.3.120.0070.07314.60
5.3.110.0100.06714.74
5.3.100.0030.08014.07
5.3.90.0130.07014.19
5.3.80.0070.06314.08
5.3.70.0070.07314.04
5.3.60.0070.06714.16
5.3.50.0100.07013.94
5.3.40.0130.07014.12
5.3.30.0000.06314.17
5.3.20.0100.06013.74
5.3.10.0030.06713.70
5.3.00.0070.07013.55
5.2.170.0000.06711.31
5.2.160.0070.06011.32
5.2.150.0070.04311.33
5.2.140.0030.06311.31
5.2.130.0200.04711.31
5.2.120.0070.04011.31
5.2.110.0070.06011.31
5.2.100.0070.04311.31
5.2.90.0100.05711.31
5.2.80.0100.05311.31
5.2.70.0000.04711.31
5.2.60.0000.06711.31
5.2.50.0000.06711.31
5.2.40.0100.05711.31
5.2.30.0070.06011.31
5.2.20.0070.05311.31
5.2.10.0070.05011.31
5.2.00.0170.05011.31
5.1.60.0030.05711.31
5.1.50.0030.05711.31
5.1.40.0070.05011.31
5.1.30.0130.04711.31
5.1.20.0030.05711.31
5.1.10.0000.05711.31
5.1.00.0070.05011.31
5.0.50.0000.04711.31
5.0.40.0030.03711.31
5.0.30.0070.06311.31
5.0.20.0130.03711.31
5.0.10.0070.04311.31
5.0.00.0030.06711.31
4.4.90.0100.01311.31
4.4.80.0000.02711.31
4.4.70.0000.03011.31
4.4.60.0000.03711.31
4.4.50.0000.03311.31
4.4.40.0000.05711.31
4.4.30.0030.03311.31
4.4.20.0030.03311.31
4.4.10.0030.03311.31
4.4.00.0030.05011.31
4.3.110.0030.02711.31
4.3.100.0000.03311.31
4.3.90.0030.03311.31
4.3.80.0070.05011.31
4.3.70.0070.02011.31
4.3.60.0030.02711.31
4.3.50.0030.03711.31
4.3.40.0030.03311.31
4.3.30.0030.03711.31
4.3.20.0070.03011.31
4.3.10.0070.03011.31
4.3.00.0030.02011.31

preferences:
54.67 ms | 401 KiB | 5 Q