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{ print ("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.0100.00614.80
7.4.00.0080.01114.77
7.3.130.0030.01614.85
7.3.120.0070.00814.88
7.3.110.0030.01414.77
7.3.100.0080.00614.72
7.3.90.0100.00714.68
7.3.80.0020.01214.80
7.3.70.0020.01014.80
7.3.60.0070.00514.80
7.3.50.0060.00614.93
7.3.40.0050.00814.87
7.3.30.0070.00714.81
7.3.20.0080.00716.72
7.3.10.0090.00516.76
7.3.00.0030.01016.68
7.2.260.0070.01115.31
7.2.250.0070.01015.04
7.2.240.0100.00615.05
7.2.230.0030.00815.17
7.2.220.0100.00615.07
7.2.210.0060.00915.01
7.2.200.0020.01015.14
7.2.190.0020.01314.98
7.2.180.0040.00715.17
7.2.170.0090.00315.03
7.2.160.0080.00415.13
7.2.150.0100.00316.84
7.2.140.0000.01016.92
7.2.130.0080.00716.92
7.2.120.0060.00616.67
7.2.110.0050.01016.77
7.2.100.0050.00816.73
7.2.90.0090.00516.93
7.2.80.0070.00717.06
7.2.70.0030.00817.06
7.2.60.0060.00816.85
7.2.50.0080.01016.86
7.2.40.0090.00317.04
7.2.30.0080.00717.00
7.2.20.0080.00817.01
7.2.10.0070.00816.78
7.2.00.0060.01017.58
7.1.330.0080.00715.99
7.1.320.0070.00515.82
7.1.310.0080.00515.89
7.1.300.0060.00615.74
7.1.290.0080.00315.89
7.1.280.0060.00615.67
7.1.270.0060.00615.56
7.1.260.0020.01015.71
7.1.250.0060.00315.83
7.1.240.0030.01315.75
7.1.230.0060.00915.76
7.1.220.0070.01015.70
7.1.210.0070.00715.82
7.1.200.0040.00715.72
7.1.190.0070.00715.77
7.1.180.0060.01015.71
7.1.170.0040.01515.45
7.1.160.0110.00315.87
7.1.150.0060.00915.82
7.1.140.0000.01515.66
7.1.130.0080.00815.73
7.1.120.0080.00715.68
7.1.110.0060.00315.58
7.1.100.0030.01015.77
7.1.90.0090.00915.84
7.1.80.0030.01315.56
7.1.70.0020.01116.49
7.1.60.0080.01117.60
7.1.50.0060.01316.45
7.1.40.0070.00715.93
7.1.30.0090.00615.75
7.1.20.0000.01115.70
7.1.10.0060.00915.42
7.1.00.0070.02019.09
7.0.330.0040.00415.43
7.0.320.0030.01015.41
7.0.310.0070.00715.23
7.0.300.0100.00715.45
7.0.290.0040.01515.31
7.0.280.0100.00315.43
7.0.270.0030.00715.45
7.0.260.0030.01015.54
7.0.250.0030.01015.48
7.0.240.0030.00915.40
7.0.230.0070.01015.40
7.0.220.0070.01315.23
7.0.210.0000.01315.39
7.0.200.0040.00416.11
7.0.190.0070.00315.62
7.0.180.0030.01015.60
7.0.170.0100.00315.59
7.0.160.0030.00715.57
7.0.150.0000.01215.54
7.0.140.0020.04518.79
7.0.130.0030.01015.55
7.0.120.0040.00715.55
7.0.110.0070.00715.48
7.0.100.0060.04117.61
7.0.90.0120.03317.71
7.0.80.0090.04017.82
7.0.70.0050.03917.73
7.0.60.0070.02517.74
7.0.50.0220.04217.89
7.0.40.0090.03817.01
7.0.30.0060.05016.99
7.0.20.0120.04316.96
7.0.10.0080.04017.01
7.0.00.0030.03317.01
5.6.400.0090.00314.73
5.6.390.0000.01114.10
5.6.380.0110.00714.11
5.6.370.0070.00714.72
5.6.360.0060.00914.45
5.6.350.0070.01314.38
5.6.340.0040.01114.64
5.6.330.0070.00714.44
5.6.320.0030.00814.30
5.6.310.0040.01214.43
5.6.300.0130.00014.45
5.6.290.0070.00714.33
5.6.280.0080.03717.70
5.6.270.0000.01314.42
5.6.260.0110.00414.76
5.6.250.0080.04017.55
5.6.240.0080.04317.53
5.6.230.0070.04617.44
5.6.220.0030.04017.60
5.6.210.0030.04717.44
5.6.200.0080.04517.98
5.6.190.0080.03517.82
5.6.180.0100.04317.74
5.6.170.0120.04217.89
5.6.160.0030.04817.67
5.6.150.0170.03717.71
5.6.140.0100.04517.75
5.6.130.0070.04617.78
5.6.120.0080.04517.83
5.6.110.0050.04417.88
5.6.100.0050.04417.79
5.6.90.0100.04017.78
5.6.80.0060.04517.46
5.6.70.0180.03317.50
5.6.60.0030.02717.41
5.6.50.0050.03517.58
5.6.40.0070.03817.53
5.6.30.0090.03817.41
5.6.20.0070.04117.52
5.6.10.0070.04117.35
5.6.00.0050.04317.38
5.5.380.0060.04117.32
5.5.370.0080.04317.28
5.5.360.0070.04317.35
5.5.350.0070.02517.45
5.5.340.0070.04117.75
5.5.330.0150.03217.43
5.5.320.0130.04617.69
5.5.310.0100.04217.51
5.5.300.0100.03517.72
5.5.290.0070.04217.45
5.5.280.0110.02617.72
5.5.270.0080.04717.66
5.5.260.0120.03317.32
5.5.250.0060.03617.60
5.5.240.0140.03917.50
5.5.230.0120.03817.26
5.5.220.0050.04617.30
5.5.210.0100.04217.21
5.5.200.0080.04017.25
5.5.190.0040.04417.35
5.5.180.0050.04417.21
5.5.170.0030.01014.53
5.5.160.0030.03117.20
5.5.150.0130.03617.31
5.5.140.0080.04017.17
5.5.130.0030.04817.29
5.5.120.0050.04717.21
5.5.110.0080.04117.30
5.5.100.0050.04917.28
5.5.90.0090.04417.37
5.5.80.0060.04317.29
5.5.70.0070.04417.23
5.5.60.0150.03817.28
5.5.50.0080.04017.25
5.5.40.0080.04017.10
5.5.30.0100.04617.29
5.5.20.0100.04217.23
5.5.10.0090.04217.21
5.5.00.0070.03817.12
5.4.450.0060.03316.73
5.4.440.0050.04716.70
5.4.430.0080.03816.55
5.4.420.0040.02916.67
5.4.410.0050.04616.66
5.4.400.0060.04116.50
5.4.390.0070.03316.53
5.4.380.0080.03816.53
5.4.370.0110.03316.56
5.4.360.0070.04316.47
5.4.350.0050.04116.56
5.4.340.0020.02916.46
5.4.330.0030.01013.89
5.4.320.0090.03816.46
5.4.310.0050.04016.46
5.4.300.0070.04116.51
5.4.290.0070.03816.40
5.4.280.0050.03016.54
5.4.270.0050.04416.56
5.4.260.0070.04016.53
5.4.250.0150.03216.51
5.4.240.0050.04216.51
5.4.230.0050.04316.46
5.4.220.0070.04316.38
5.4.210.0170.01816.49
5.4.200.0130.03616.56
5.4.190.0090.02516.49
5.4.180.0050.04116.39
5.4.170.0030.02416.47
5.4.160.0110.01816.48
5.4.150.0050.04516.50
5.4.140.0050.02515.14
5.4.130.0030.03515.14
5.4.120.0000.02715.20
5.4.110.0070.02215.17
5.4.100.0070.04215.21
5.4.90.0100.03215.14
5.4.80.0090.03515.14
5.4.70.0050.04215.18
5.4.60.0050.04215.16
5.4.50.0080.04015.11
5.4.40.0100.03315.21
5.4.30.0070.02915.07
5.4.20.0070.03515.11
5.4.10.0020.04215.15
5.4.00.0060.03914.89
5.3.290.0090.03914.27
5.3.280.0050.04214.31
5.3.270.0050.03814.30
5.3.260.0080.02714.27
5.3.250.0040.03814.32
5.3.240.0100.01714.25
5.3.230.0020.04014.22
5.3.220.0050.04114.26
5.3.210.0080.04214.27
5.3.200.0000.02614.24
5.3.190.0090.04114.31
5.3.180.0100.03614.20
5.3.170.0050.04014.20
5.3.160.0100.02814.25
5.3.150.0070.03714.27
5.3.140.0100.03514.20
5.3.130.0060.04314.21
5.3.120.0080.02214.20
5.3.110.0020.02714.24
5.3.100.0070.03513.98
5.3.90.0050.03513.93
5.3.80.0120.03813.99
5.3.70.0050.02813.91
5.3.60.0060.04313.99
5.3.50.0100.03213.92
5.3.40.0030.04513.95
5.3.30.0070.03513.87
5.3.20.0050.02413.80
5.3.10.0010.04413.79
5.3.00.0020.03213.80
5.2.170.0030.06311.27
5.2.160.0000.06711.11
5.2.150.0030.05711.19
5.2.140.0070.06311.07
5.2.130.0030.06011.23
5.2.120.0130.05311.18
5.2.110.0070.06311.11
5.2.100.0070.05011.06
5.2.90.0070.05311.16
5.2.80.0130.05311.25
5.2.70.0000.06310.96
5.2.60.0030.06311.16
5.2.50.0030.05311.12
5.2.40.0070.05710.88
5.2.30.0030.06311.00
5.2.20.0100.03311.10
5.2.10.0100.02310.88
5.2.00.0030.03310.69
5.1.60.0100.01710.48
5.1.50.0030.02310.48
5.1.40.0030.02010.48
5.1.30.0000.02710.48
5.1.20.0030.02310.49
5.1.10.0000.02710.48
5.1.00.0000.02710.48
5.0.50.0000.02310.48
5.0.40.0000.02010.48
5.0.30.0030.02710.48
5.0.20.0000.02010.48
5.0.10.0000.02710.48
5.0.00.0000.03310.48
4.4.90.0000.04010.48
4.4.80.0030.03710.48
4.4.70.0030.03310.48
4.4.60.0030.03010.48
4.4.50.0000.04010.48
4.4.40.0070.04310.48
4.4.30.0000.01310.48
4.4.20.0030.01010.48
4.4.10.0000.01710.48
4.4.00.0000.02310.48
4.3.110.0030.01310.48
4.3.100.0030.01310.48
4.3.90.0030.01310.48
4.3.80.0000.02310.48
4.3.70.0000.01310.48
4.3.60.0030.01310.48
4.3.50.0000.01710.48
4.3.40.0000.02310.48
4.3.30.0030.01310.48
4.3.20.0030.01310.48
4.3.10.0030.01310.48
4.3.00.0000.01310.48

preferences:
37.86 ms | 401 KiB | 5 Q