3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract public function rideWave($amplitude); public function applyWax($waxType){ $this->printMessage("Ahh, all waxed up with '".$waxType."', ready to go!"); } public function paddleOut(){ $this->printMessage("Paddling Out...."); } public function screamShark(){ $this->printMessage("SHARK!!"); } public function printMessage($msg = ""){ $lt = (isset($_SERVER['HTTP_USER_AGENT']))?"<br />":"\r\n"; print($msg.$lt); } } /** * RookieSurfer Class * * This surfer is green and can barely surf =) * @package hangten */ class RookieSurfer extends Surfer { public function rideWave($amplitude = 1){ $this->printMessage("Trying.. Trying.. to ride a ".$amplitude."ft. wave, whew!"); } } /** * ProSurfer Class * * This surfer is crazy skilled!! * @package hangten */ class ProSurfer extends Surfer { public function rideWave($amplitude = 8){ $this->printMessage("Riding a ".$amplitude."ft. wave backwards doing a backflip!"); } public function killSharkWithBoard(){ $this->printMessage("Totally just sliced that shark in two, he's over it!! booya!"); } } if(phpversion() < 5.3){ echo("Error : must have PHP version 5.3+ to run this script."); exit(); } // Rookie Instantiation $rookie = new RookieSurfer; $rookie->applyWax("Candle Wax"); $rookie->paddleOut(); $rookie->rideWave(2); $rookie->screamShark(); // Pro Instantiation $pro = new ProSurfer; $pro->applyWax("Sex Wax"); $pro->paddleOut(); $pro->rideWave(50); $pro->killSharkWithBoard();

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)
7.4.10.0090.00316.52
7.4.00.0100.01016.55
7.3.130.0090.00916.23
7.3.120.0030.01316.44
7.3.110.0060.00916.38
7.3.100.0060.00316.25
7.3.90.0030.01016.61
7.3.80.0080.00816.22
7.3.70.0100.00316.28
7.3.60.0040.01116.45
7.3.50.0090.00616.21
7.3.40.0050.00816.29
7.3.30.0060.00616.25
7.3.20.0070.00718.25
7.3.10.0060.00918.27
7.3.00.0090.00618.27
7.2.260.0080.01116.34
7.2.250.0100.00716.82
7.2.240.0060.01016.70
7.2.230.0130.00316.38
7.2.220.0000.01016.74
7.2.210.0100.00716.59
7.2.200.0030.01616.70
7.2.190.0060.00616.54
7.2.180.0090.00616.55
7.2.170.0070.00716.63
7.2.160.0080.00316.53
7.2.150.0060.00918.28
7.2.140.0000.01718.40
7.2.130.0100.00618.49
7.2.120.0090.00318.32
7.2.110.0060.01018.40
7.2.100.0150.00318.37
7.2.90.0070.00718.45
7.2.80.0090.00618.57
7.2.70.0070.00718.47
7.2.60.0080.00418.58
7.2.50.0110.00418.56
7.2.40.0100.00718.27
7.2.30.0040.00918.35
7.2.20.0060.01018.39
7.2.10.0030.00718.38
7.2.00.0030.01018.86
7.1.330.0000.01317.25
7.1.320.0100.00717.41
7.1.310.0040.01517.43
7.1.300.0030.00917.31
7.1.290.0110.00017.19
7.1.280.0080.00017.28
7.1.270.0110.00417.50
7.1.260.0110.00417.20
7.1.250.0130.00617.23
7.1.240.0030.01017.34
7.1.230.0040.01217.27
7.1.220.0080.00617.27
7.1.210.0060.00317.34
7.1.200.0040.01217.21
7.1.190.0080.00417.14
7.1.180.0030.01017.18
7.1.170.0030.01017.29
7.1.160.0100.00317.38
7.1.150.0110.00417.14
7.1.140.0030.00717.09
7.1.130.0080.00817.30
7.1.120.0060.01017.39
7.1.110.0030.00717.14
7.1.100.0000.01017.30
7.1.90.0060.00617.25
7.1.80.0040.01217.35
7.1.70.0070.00717.35
7.1.60.0070.00918.29
7.1.50.0040.01417.02
7.1.40.0060.00817.32
7.1.30.0040.01117.32
7.1.20.0120.00317.33
7.1.10.0090.00617.17
7.1.00.0030.02519.85
7.0.330.0030.00916.97
7.0.320.0070.00716.98
7.0.310.0110.00416.95
7.0.300.0070.00717.04
7.0.290.0030.01016.90
7.0.280.0030.01017.03
7.0.270.0090.00617.03
7.0.260.0070.00617.06
7.0.250.0060.00617.13
7.0.240.0070.00716.99
7.0.230.0030.01416.96
7.0.220.0130.00617.02
7.0.210.0090.00916.85
7.0.200.0050.00516.82
7.0.190.0100.00617.02
7.0.180.0030.00617.08
7.0.170.0040.01117.01
7.0.160.0060.00317.16
7.0.150.0030.00916.91
7.0.140.0030.04619.59
7.0.130.0070.01017.05
7.0.120.0070.04019.51
7.0.110.0030.00717.13
7.0.100.0040.00716.88
7.0.90.0030.00917.13
7.0.80.0030.01016.90
7.0.70.0100.00716.76
7.0.60.0050.03818.60
7.0.50.0050.03117.50
7.0.40.0030.04717.43
7.0.30.0340.03717.49
7.0.20.0100.03517.50
7.0.10.0120.03517.57
7.0.00.0020.03517.54
5.6.400.0100.01015.93
5.6.390.0060.00315.99
5.6.380.0070.01115.94
5.6.370.0030.00615.91
5.6.360.0090.00615.80
5.6.350.0080.00315.79
5.6.340.0090.00616.05
5.6.330.0060.01215.99
5.6.320.0120.00316.08
5.6.310.0000.00916.00
5.6.300.0000.01716.09
5.6.290.0060.00915.68
5.6.280.0050.04118.42
5.6.270.0030.01015.93
5.6.260.0070.00715.89
5.6.250.0060.00315.75
5.6.240.0030.00915.91
5.6.230.0070.01015.90
5.6.220.0100.00015.88
5.6.210.0030.03418.27
5.6.200.0100.04017.00
5.6.190.0050.04518.16
5.6.180.0350.02518.20
5.6.170.0250.04018.24
5.6.160.0060.02418.23
5.6.150.0070.04217.12
5.6.140.0100.02317.08
5.6.130.0050.02317.16
5.6.120.0080.03718.45
5.6.110.0060.04118.51
5.6.100.0020.05018.45
5.6.90.0070.02218.45
5.6.80.0080.02318.08
5.6.70.0970.03518.11
5.6.60.0080.00815.94
5.6.50.0040.00715.82
5.6.40.0110.00715.84
5.6.30.0060.00916.00
5.6.20.0040.00815.70
5.6.10.0140.00315.80
5.6.00.0070.01115.85
5.5.380.0030.00615.99
5.5.370.0090.00615.86
5.5.360.0040.00815.56
5.5.350.0140.04217.95
5.5.340.0000.02817.01
5.5.330.0040.04618.08
5.5.320.1630.02818.04
5.5.310.0100.02918.01
5.5.300.0050.03316.92
5.5.290.0070.02216.96
5.5.280.0050.04518.32
5.5.270.0080.03918.36
5.5.260.0070.04918.05
5.5.250.0060.03618.14
5.5.240.0120.04517.96
5.5.230.0040.00715.64
5.5.220.0060.00915.87
5.5.210.0110.00415.69
5.5.200.0110.00415.63
5.5.190.0050.00815.73
5.5.180.0070.01015.59
5.5.170.0070.01315.53
5.5.160.0020.01415.87
5.5.150.0000.01515.69
5.5.140.0000.01415.85
5.5.130.0000.01315.86
5.5.120.0030.00715.73
5.5.110.0060.01015.79
5.5.100.0000.01015.66
5.5.90.0040.01115.75
5.5.80.0040.00715.80
5.5.70.0040.01115.83
5.5.60.0030.01415.82
5.5.50.0060.00615.52
5.5.40.0100.00315.75
5.5.30.0060.00615.97
5.5.20.0000.01015.83
5.5.10.0030.01015.69
5.5.00.0060.00915.77
5.4.450.0020.02516.07
5.4.440.0060.02616.13
5.4.430.0030.02416.06
5.4.420.0050.02216.00
5.4.410.0050.02016.02
5.4.400.0040.02215.78
5.4.390.0030.02115.77
5.4.380.0020.02815.93
5.4.370.0080.02315.95
5.4.360.0100.04115.92
5.4.350.0070.03915.81
5.4.340.0050.03015.98
5.4.330.0060.00912.70
5.4.320.0030.04615.91
5.4.310.0000.03015.77
5.4.300.0020.03015.81
5.4.290.0030.03815.92
5.4.280.0080.04115.77
5.4.270.0020.03915.80
5.4.260.0060.03115.81
5.4.250.0100.03815.97
5.4.240.0050.04015.96
5.4.230.0080.02115.93
5.4.220.0060.02415.80
5.4.210.0050.03015.92
5.4.200.0030.02215.92
5.4.190.0050.02515.90
5.4.180.0100.01815.94
5.4.170.0070.04015.78
5.4.160.0060.02115.77
5.4.150.0040.02615.92
5.4.140.0050.03514.60
5.4.130.0080.03214.62
5.4.120.0100.03414.58
5.4.110.0050.04314.57
5.4.100.0080.02614.59
5.4.90.0050.03914.56
5.4.80.0070.03514.57
5.4.70.0060.03814.59
5.4.60.0020.02914.50
5.4.50.0030.04114.48
5.4.40.0070.04214.54
5.4.30.0080.04014.48
5.4.20.0000.02914.48
5.4.10.0090.02314.67
5.4.00.0050.03114.32
5.3.290.0070.03313.91
5.3.280.0130.03813.74
5.3.270.0020.03613.84
5.3.260.0080.02313.92
5.3.250.0020.03013.84
5.3.240.0090.04013.74
5.3.230.0050.03913.83
5.3.220.0070.04313.95
5.3.210.0050.04713.80
5.3.200.0100.03513.69
5.3.190.0100.03013.79
5.3.180.0080.04013.82
5.3.170.0050.03613.89
5.3.160.0040.04213.92
5.3.150.0050.04313.90
5.3.140.0080.03213.80
5.3.130.0090.03913.72
5.3.120.0080.03013.74
5.3.110.0050.03813.80
5.3.100.0030.02513.65
5.3.90.0020.03313.51
5.3.80.0100.04013.48
5.3.70.0080.02813.50
5.3.60.0030.02813.49
5.3.50.0030.04313.47
5.3.40.0030.03213.45
5.3.30.0020.03713.51
5.3.20.0050.02513.38
5.3.10.0080.03313.42
5.3.00.0050.03713.26
5.2.170.0030.06011.23
5.2.160.0070.05311.13
5.2.150.0030.05011.16
5.2.140.0070.06311.11
5.2.130.0070.06311.16
5.2.120.0030.04311.00
5.2.110.0100.05711.27
5.2.100.0030.03011.11
5.2.90.0070.06011.18
5.2.80.0030.03311.16
5.2.70.0030.03011.18
5.2.60.0070.06011.06
5.2.50.0030.06311.06
5.2.40.0030.05010.92
5.2.30.0030.03311.13
5.2.20.0000.04011.11
5.2.10.0070.03010.84
5.2.00.0070.05710.69
5.1.60.0030.03310.00
5.1.50.0000.04710.02
5.1.40.0000.0479.96
5.1.30.0100.04010.40
5.1.20.0030.05010.44
5.1.10.0070.04310.06
5.1.00.0000.04710.08
5.0.50.0070.0338.53
5.0.40.0000.0378.39
5.0.30.0070.0478.22
5.0.20.0000.0338.37
5.0.10.0000.0208.21
5.0.00.0070.0638.33
4.4.90.0030.0137.82
4.4.80.0030.0277.82
4.4.70.0030.0207.82
4.4.60.0070.0337.82
4.4.50.0030.0237.82
4.4.40.0000.0537.82
4.4.30.0000.0377.82
4.4.20.0030.0277.82
4.4.10.0000.0277.82
4.4.00.0030.0477.82
4.3.110.0030.0307.82
4.3.100.0000.0377.82
4.3.90.0030.0137.82
4.3.80.0000.0307.82
4.3.70.0070.0337.82
4.3.60.0100.0307.82
4.3.50.0070.0337.82
4.3.40.0000.0507.82
4.3.30.0000.0377.82
4.3.20.0000.0337.82
4.3.10.0000.0337.82
4.3.00.0000.0377.82

preferences:
41.91 ms | 400 KiB | 5 Q