3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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(strnatcmp(phpversion(),'5.3.0') < 0){ 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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0040.00816.37
7.3.00.0030.01116.67
7.2.130.0060.00816.95
7.2.120.0050.00517.02
7.2.110.0100.00116.92
7.2.100.0040.00917.04
7.2.90.0020.01017.07
7.2.80.0070.00417.01
7.2.70.0110.00716.64
7.2.60.0060.00916.95
7.2.50.0040.00716.97
7.2.40.0080.00217.16
7.2.30.0020.00917.07
7.2.20.0100.00416.80
7.2.10.0060.00616.86
7.2.00.0080.00617.90
7.1.250.0060.00615.57
7.1.240.0030.00715.76
7.1.230.0090.00315.86
7.1.220.0000.01215.38
7.1.210.0040.00415.74
7.1.200.0030.00615.59
7.1.190.0000.01015.79
7.1.180.0060.00315.62
7.1.170.0000.01015.87
7.1.160.0040.00715.87
7.1.150.0000.01315.58
7.1.140.0030.00915.69
7.1.130.0070.00715.39
7.1.120.0110.00415.89
7.1.110.0060.00615.66
7.1.100.0060.00616.83
7.1.90.0040.00715.64
7.1.80.0030.00915.42
7.1.70.0040.01216.37
7.1.60.0120.00617.68
7.1.50.0080.01016.30
7.1.40.0060.00315.57
7.1.30.0050.00515.75
7.1.20.0040.00715.75
7.1.10.0070.00315.66
7.1.00.0040.04319.01
7.0.330.0030.00614.89
7.0.320.0080.00414.81
7.0.310.0040.00415.27
7.0.300.0080.00315.16
7.0.290.0000.01415.15
7.0.280.0030.00515.21
7.0.270.0070.00415.29
7.0.260.0040.01115.22
7.0.250.0080.00415.34
7.0.240.0000.01315.21
7.0.230.0000.01615.44
7.0.220.0030.01015.33
7.0.210.0030.00715.45
7.0.200.0030.00716.15
7.0.190.0040.00415.08
7.0.180.0060.00315.44
7.0.170.0030.01015.35
7.0.160.0060.00615.38
7.0.150.0080.00415.48
7.0.140.0040.03818.68
7.0.130.0000.00915.03
7.0.120.0040.00415.52
7.0.110.0030.00715.38
7.0.100.0030.00715.49
7.0.90.0040.00715.16
7.0.80.0030.00614.99
7.0.70.0030.00715.32
7.0.60.0170.02517.66
7.0.50.0050.04416.60
7.0.40.0050.04616.68
7.0.30.0190.03616.77
7.0.20.0160.02716.79
7.0.10.0020.02816.67
7.0.00.0050.04716.70
5.6.380.0040.00714.32
5.6.370.0060.00614.28
5.6.360.0130.00014.04
5.6.350.0060.00614.16
5.6.340.0080.00314.35
5.6.330.0030.00614.32
5.6.320.0080.00414.30
5.6.310.0030.00714.48
5.6.300.0110.00314.47
5.6.290.0030.01014.22
5.6.280.0020.04217.54
5.6.270.0000.01214.48
5.6.260.0030.01014.54
5.6.250.0040.00714.07
5.6.240.0000.01114.45
5.6.230.0070.00714.34
5.6.220.0040.01414.30
5.6.210.0050.03617.40
5.6.200.0070.04316.33
5.6.190.0070.02517.32
5.6.180.0150.04217.29
5.6.170.0080.03417.45
5.6.160.0050.04817.38
5.6.150.0050.02916.28
5.6.140.0100.02316.21
5.6.130.0050.03716.08
5.6.120.0170.02417.60
5.6.110.0080.04517.71
5.6.100.0140.03817.62
5.6.90.0100.03317.71
5.6.80.0080.02817.48
5.6.70.0060.00614.27
5.6.60.0040.01114.32
5.6.50.0100.00614.31
5.6.40.0060.00314.35
5.6.30.0060.00614.25
5.6.20.0070.00713.87
5.6.10.0000.00814.08
5.6.00.0030.01214.31
5.5.380.0000.01110.80
5.5.370.0080.00311.02
5.5.360.0000.00611.02
5.5.350.0200.03715.87
5.5.340.0100.03214.73
5.5.330.0070.03715.82
5.5.320.0040.04415.72
5.5.310.0180.03615.77
5.5.300.0030.04414.56
5.5.290.0050.02214.57
5.5.280.0070.04516.13
5.5.270.0030.03316.00
5.5.260.0090.04215.94
5.5.250.0060.03515.56
5.5.240.0050.03815.74
5.5.230.0040.00410.97
5.5.220.0030.00610.94
5.5.210.0030.00610.82
5.5.200.0000.00811.39
5.5.190.0040.00411.21
5.5.180.0070.00410.83
5.5.170.0060.00611.11
5.5.160.0000.00610.90
5.5.150.0070.00011.16
5.5.140.0000.01011.31
5.5.130.0000.01010.97
5.5.120.0040.00710.88
5.5.110.0070.00411.05
5.5.100.0110.00311.18
5.5.90.0060.00011.05
5.5.80.0030.00610.96
5.5.70.0040.00811.16
5.5.60.0030.00310.71
5.5.50.0000.01110.96
5.5.40.0000.01111.30
5.5.30.0000.00711.23
5.5.20.0000.00711.09
5.5.10.0050.00511.12
5.5.00.0030.00611.14
5.4.450.0200.03315.12
5.4.440.0150.02115.31
5.4.430.0100.03015.46
5.4.420.0150.02015.23
5.4.410.0150.02815.28
5.4.400.0140.03615.01
5.4.390.0150.03815.02
5.4.380.0150.03315.10
5.4.370.0130.02315.15
5.4.360.0080.02315.16
5.4.350.0070.02215.33
5.4.340.0110.02115.10
5.4.330.0050.00511.22
5.4.320.0120.02014.93
5.4.310.0100.02115.02
5.4.300.0110.02214.99
5.4.290.0120.02115.07
5.4.280.0070.02415.06
5.4.270.0160.01815.05
5.4.260.0090.02415.21
5.4.250.0130.02014.87
5.4.240.0080.02814.89
5.4.230.0120.02215.06
5.4.220.0100.02215.05
5.4.210.0070.02315.06
5.4.200.0080.02415.16
5.4.190.0120.01715.13
5.4.180.0070.02215.01
5.4.170.0100.02415.18
5.4.160.0130.02014.88
5.4.150.0100.02214.85
5.4.140.0180.03213.92
5.4.130.0130.02613.72
5.4.120.0190.03513.67
5.4.110.0130.02013.62
5.4.100.0160.03513.64
5.4.90.0150.03113.62
5.4.80.0150.03313.66
5.4.70.0170.03813.63
5.4.60.0130.03513.44
5.4.50.0120.03213.79
5.4.40.0150.03513.80
5.4.30.0150.02713.83
5.4.20.0150.03513.75
5.4.10.0200.03713.67
5.4.00.0120.04213.38
5.3.290.0070.02912.82
5.3.280.0060.02412.60
5.3.270.0050.02512.65
5.3.260.0080.02012.55
5.3.250.0100.04212.63
5.3.240.0130.03512.41
5.3.230.0140.03212.65
5.3.220.0120.03512.54
5.3.210.0120.02712.45
5.3.200.0110.02012.55
5.3.190.0180.03712.53
5.3.180.0140.03212.42
5.3.170.0220.03312.61
5.3.160.0170.03812.63
5.3.150.0170.03512.63
5.3.140.0100.03212.63
5.3.130.0170.03412.66
5.3.120.0140.03612.51
5.3.110.0170.03612.41
5.3.100.0180.03312.48
5.3.90.0160.03112.31
5.3.80.0110.02812.10
5.3.70.0130.03812.24
5.3.60.0150.03012.27
5.3.50.0160.02512.14
5.3.40.0120.02812.26
5.3.30.0130.03812.26
5.3.20.0100.02512.10
5.3.10.0120.02711.99
5.3.00.0100.02711.92
5.2.170.0120.03211.20
5.2.160.0150.02311.20
5.2.150.0140.02911.20
5.2.140.0110.03011.20
5.2.130.0190.02011.20
5.2.120.0080.02111.20
5.2.110.0080.02911.20
5.2.100.0100.02011.20
5.2.90.0120.02211.20
5.2.80.0160.02311.20
5.2.70.0120.02311.20
5.2.60.0140.02611.20
5.2.50.0150.02811.20
5.2.40.0130.03011.20
5.2.30.0110.03011.20
5.2.20.0150.02411.20
5.2.10.0100.02611.20
5.2.00.0140.02211.20
5.1.60.0120.02611.20
5.1.50.0110.02611.20
5.1.40.0080.02011.20
5.1.30.0070.02811.20
5.1.20.0090.03111.20
5.1.10.0050.02411.20
5.1.00.0100.02211.20
5.0.50.0100.01011.20
5.0.40.0060.01811.20
5.0.30.0050.02111.20
5.0.20.0080.02311.20
5.0.10.0050.02211.20
5.0.00.0080.03011.20
4.4.90.0070.01211.20
4.4.80.0070.01711.20
4.4.70.0060.02011.20
4.4.60.0030.01811.20
4.4.50.0050.01311.20
4.4.40.0080.02311.20
4.4.30.0050.01711.20
4.4.20.0000.01611.20
4.4.10.0110.01011.20
4.4.00.0050.02911.20
4.3.110.0030.01511.20
4.3.100.0050.01011.20
4.3.90.0030.01611.20
4.3.80.0050.02311.20
4.3.70.0040.01811.20
4.3.60.0040.01811.20
4.3.50.0070.01911.20
4.3.40.0030.03011.20
4.3.30.0040.01711.20
4.3.20.0020.02211.20
4.3.10.0050.01711.20
4.3.00.0050.01811.20