3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Casilla { public $wumpus = false; public $pit = false; private $gold = false; public function taken(){ if ($this->wumpus || $this-> pit || $this->gold){ return true; } return false; }//end taken function }//end casilla class class Board{ private $board; public function iniBoard(){ for($i=0;$i<9;$i++){ $this->board[$i] = new Casilla(); } }//end in public function iniPits(){ $pitNum = 0; while ($pitNum < 3) { $randomTmp = rand(1, 8); if($this->board[$randomTmp]->taken() == false){ $this->board[$randomTmp]->pit = true; $pitNum = $pitNum + 1; } }//end while }//end inipits public function printBoard(){ for($i=0;$i<9;$i++){ if($this->board[$i]->pit == true){ print ("pit"); }else{ echo "empty"; } } } }//end board class echo("testing<br>"); $mainBoard = new Board(); $mainBoard->iniBoard(); $mainBoard->iniPits(); $mainBoard->printBoard(); ?>

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.0050.01215.21
7.4.00.0030.01514.97
7.3.130.0100.00714.97
7.3.120.0100.00615.04
7.3.110.0120.00615.05
7.3.100.0130.00014.89
7.3.90.0120.00314.83
7.3.80.0000.01014.66
7.3.70.0040.01114.86
7.3.60.0070.00314.94
7.3.50.0030.00615.00
7.3.40.0040.00414.95
7.3.30.0030.01314.82
7.3.20.0030.01316.90
7.3.10.0080.00416.80
7.3.00.0110.00316.74
7.2.260.0150.00414.70
7.2.250.0060.01315.36
7.2.240.0060.00915.27
7.2.230.0030.01515.11
7.2.220.0070.01014.84
7.2.210.0030.01315.24
7.2.200.0100.00714.96
7.2.190.0040.00715.29
7.2.180.0040.01115.14
7.2.170.0070.01015.14
7.2.160.0070.00715.07
7.2.150.0030.00717.06
7.2.140.0040.01216.98
7.2.130.0080.01216.85
7.2.120.0120.00316.99
7.2.110.0030.00616.77
7.2.100.0060.00616.96
7.2.90.0100.00716.70
7.2.80.0000.01516.95
7.2.70.0040.00716.97
7.2.60.0070.00716.97
7.2.50.0070.00716.93
7.2.40.0060.00916.93
7.2.30.0070.00716.80
7.2.20.0090.00917.04
7.2.10.0060.00916.67
7.2.00.0040.01118.01
7.1.330.0060.00615.97
7.1.320.0060.00915.65
7.1.310.0000.01415.91
7.1.300.0090.00015.69
7.1.290.0020.00515.79
7.1.280.0040.00915.90
7.1.270.0060.00315.86
7.1.260.0040.00815.88
7.1.250.0100.00315.86
7.1.240.0040.01415.76
7.1.230.0030.00815.73
7.1.220.0030.01315.61
7.1.210.0070.01115.86
7.1.200.0060.00615.77
7.1.190.0030.01015.88
7.1.180.0110.00315.61
7.1.170.0000.01415.66
7.1.160.0030.01415.55
7.1.150.0030.00915.95
7.1.140.0080.00815.83
7.1.130.0030.01315.55
7.1.120.0030.00515.66
7.1.110.0070.00715.96
7.1.100.0040.00815.83
7.1.90.0080.00816.08
7.1.80.0130.00315.64
7.1.70.0040.00816.48
7.1.60.0060.00817.52
7.1.50.0030.01016.43
7.1.40.0100.00315.83
7.1.30.0030.01015.78
7.1.20.0000.01415.94
7.1.10.0040.00715.81
7.1.00.0020.02419.06
7.0.330.0040.01115.35
7.0.320.0000.01415.61
7.0.310.0060.00915.06
7.0.300.0000.01415.43
7.0.290.0080.00815.38
7.0.280.0000.01115.63
7.0.270.0070.01015.42
7.0.260.0040.00415.35
7.0.250.0090.00315.29
7.0.240.0060.00315.53
7.0.230.0090.00615.22
7.0.220.0100.00615.36
7.0.210.0120.00615.25
7.0.200.0030.00915.96
7.0.190.0090.00615.62
7.0.180.0040.01115.64
7.0.170.0030.01015.47
7.0.160.0000.01115.52
7.0.150.0070.00315.43
7.0.140.0080.03218.84
7.0.130.0090.00615.25
7.0.120.0000.01415.58
7.0.110.0030.01315.48
7.0.100.0080.03717.62
7.0.90.0070.05017.70
7.0.80.0100.02717.61
7.0.70.0080.04617.69
7.0.60.0070.04717.78
7.0.50.0110.02817.83
7.0.40.0070.02416.85
7.0.30.0020.02716.79
7.0.20.0070.02516.74
7.0.10.0060.02116.78
7.0.00.0030.02616.83
5.6.400.0030.00714.57
5.6.390.0170.00014.45
5.6.380.0070.00414.82
5.6.370.0090.00914.82
5.6.360.0150.00314.53
5.6.350.0030.01014.75
5.6.340.0000.00814.33
5.6.330.0060.01114.58
5.6.320.0040.00714.52
5.6.310.0060.01314.27
5.6.300.0100.00314.32
5.6.290.0080.00314.64
5.6.280.0070.03717.68
5.6.270.0070.01014.67
5.6.260.0030.01014.61
5.6.250.0070.04017.63
5.6.240.0060.04817.49
5.6.230.0130.04317.68
5.6.220.0050.04217.58
5.6.210.0050.04417.57
5.6.200.0090.04317.81
5.6.190.0070.04817.77
5.6.180.0030.02817.77
5.6.170.0060.02317.70
5.6.160.0030.04017.74
5.6.150.0030.03617.68
5.6.140.0060.03117.87
5.6.130.0060.03517.86
5.6.120.0030.02817.83
5.6.110.0050.03017.78
5.6.100.0100.03517.79
5.6.90.0070.03917.79
5.6.80.0040.02417.45
5.6.70.0000.03017.37
5.6.60.0080.02317.38
5.6.50.0080.02717.51
5.6.40.0050.03717.35
5.6.30.0070.02217.35
5.6.20.0080.02517.33
5.6.10.0000.04017.32
5.6.00.0050.02317.56
5.5.380.0110.04217.45
5.5.370.0090.04617.46
5.5.360.0130.03917.29
5.5.350.0070.04417.47
5.5.340.0060.04817.64
5.5.330.0060.02617.62
5.5.320.0030.02817.61
5.5.310.0100.04017.65
5.5.300.0030.02917.58
5.5.290.0030.03817.73
5.5.280.0080.03117.74
5.5.270.0080.02117.53
5.5.260.0070.04017.74
5.5.250.0020.04217.45
5.5.240.0060.02117.37
5.5.230.0020.02817.34
5.5.220.0020.02917.08
5.5.210.0050.02317.25
5.5.200.0070.02717.37
5.5.190.0000.02617.36
5.5.180.0060.03617.29
5.5.170.0110.00314.30
5.5.160.0040.02817.20
5.5.150.0080.01917.25
5.5.140.0050.03117.39
5.5.130.0010.03017.27
5.5.120.0050.02817.21
5.5.110.0080.01817.17
5.5.100.0070.02417.13
5.5.90.0070.02317.31
5.5.80.0030.04317.31
5.5.70.0070.03617.23
5.5.60.0030.04017.29
5.5.50.0090.02417.11
5.5.40.0050.04417.08
5.5.30.0050.04517.04
5.5.20.0070.04317.28
5.5.10.0070.03917.01
5.5.00.0070.04317.23
5.4.450.0070.04415.06
5.4.440.0000.03115.30
5.4.430.0030.02315.21
5.4.420.0030.02515.28
5.4.410.0020.02215.25
5.4.400.0030.03514.99
5.4.390.0070.04015.25
5.4.380.0020.02315.18
5.4.370.0030.02014.83
5.4.360.0020.03815.14
5.4.350.0020.02215.07
5.4.340.0020.02515.08
5.4.330.0000.00910.92
5.4.320.0030.02314.98
5.4.310.0030.02215.18
5.4.300.0050.01815.04
5.4.290.0030.02314.95
5.4.280.0050.02215.11
5.4.270.0030.01815.17
5.4.260.0020.02815.09
5.4.250.0030.03115.18
5.4.240.0020.02315.19
5.4.230.0020.04415.01
5.4.220.0050.04014.93
5.4.210.0070.04215.13
5.4.200.0020.02915.14
5.4.190.0030.02515.15
5.4.180.0050.04015.08
5.4.170.0080.03715.18
5.4.160.0050.04315.21
5.4.150.0050.04414.97
5.4.140.0020.03013.69
5.4.130.0070.04013.72
5.4.120.0030.03813.65
5.4.110.0060.04113.82
5.4.100.0090.02613.75
5.4.90.0070.03913.85
5.4.80.0050.04313.97
5.4.70.0040.04013.76
5.4.60.0090.03313.86
5.4.50.0030.03913.85
5.4.40.0080.03213.85
5.4.30.0020.04513.82
5.4.20.0080.03513.85
5.4.10.0070.03913.79
5.4.00.0020.03713.54
5.3.290.0040.02712.72
5.3.280.0040.04012.54
5.3.270.0030.03312.60
5.3.260.0120.03212.64
5.3.250.0120.03512.70
5.3.240.0020.04312.61
5.3.230.0070.03712.65
5.3.220.0050.04012.59
5.3.210.0020.04512.47
5.3.200.0030.03812.61
5.3.190.0000.03212.51
5.3.180.0100.03312.72
5.3.170.0050.03812.60
5.3.160.0090.03512.75
5.3.150.0060.02512.67
5.3.140.0030.03812.69
5.3.130.0030.03912.74
5.3.120.0030.02712.66
5.3.110.0050.03312.63
5.3.100.0050.02612.32
5.3.90.0060.03512.41
5.3.80.0050.04012.35
5.3.70.0090.03712.33
5.3.60.0070.03512.38
5.3.50.0050.04112.23
5.3.40.0070.03212.15
5.3.30.0050.03512.19
5.3.20.0030.03812.08
5.3.10.0020.04212.08
5.3.00.0020.03612.02
5.2.170.0070.06011.09
5.2.160.0070.04711.20
5.2.150.0000.06711.11
5.2.140.0070.06011.29
5.2.130.0000.05311.07
5.2.120.0070.06311.03
5.2.110.0030.04711.21
5.2.100.0030.06711.22
5.2.90.0070.05711.10
5.2.80.0030.04711.11
5.2.70.0000.06711.23
5.2.60.0100.05310.98
5.2.50.0000.06011.07
5.2.40.0030.06711.08
5.2.30.0200.05011.13
5.2.20.0100.05710.98
5.2.10.0000.04011.02
5.2.00.0030.06010.77
5.1.60.0070.04710.12
5.1.50.0070.05010.05
5.1.40.0030.05010.09
5.1.30.0030.05710.37
5.1.20.0030.05710.50
5.1.10.0030.05010.15
5.1.00.0070.05310.08
5.0.50.0070.0409.85
5.0.40.0000.0479.85
5.0.30.0030.0639.85
5.0.20.0030.0439.85
5.0.10.0000.0479.85
5.0.00.0030.0609.85
4.4.90.0000.0339.85
4.4.80.0030.0379.85
4.4.70.0000.0409.85
4.4.60.0070.0309.85
4.4.50.0030.0379.85
4.4.40.0030.0539.85
4.4.30.0000.0379.85
4.4.20.0000.0209.85
4.4.10.0030.0339.85
4.4.00.0000.0579.85
4.3.110.0000.0309.85
4.3.100.0000.0339.85
4.3.90.0030.0339.85
4.3.80.0030.0539.85
4.3.70.0000.0379.85
4.3.60.0000.0279.85
4.3.50.0000.0379.85
4.3.40.0000.0539.85
4.3.30.0030.0279.85
4.3.20.0000.0409.85
4.3.10.0000.0379.85
4.3.00.0070.0309.85

preferences:
38.25 ms | 401 KiB | 5 Q