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){ echo ("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.01015.14
7.4.00.0070.01415.11
7.3.130.0050.01114.89
7.3.120.0060.01215.19
7.3.110.0100.01014.79
7.3.100.0040.00815.14
7.3.90.0130.00314.91
7.3.80.0030.01514.84
7.3.70.0090.00614.72
7.3.60.0070.00714.82
7.3.50.0140.00014.94
7.3.40.0080.00514.98
7.3.30.0080.00814.89
7.3.20.0080.00816.59
7.3.10.0120.00316.71
7.3.00.0090.00616.81
7.2.260.0070.01415.13
7.2.250.0140.00715.03
7.2.240.0030.01015.11
7.2.230.0070.01115.18
7.2.220.0130.00315.01
7.2.210.0090.00015.02
7.2.200.0030.01215.13
7.2.190.0000.01215.13
7.2.180.0060.00315.09
7.2.170.0110.00415.15
7.2.160.0000.01014.95
7.2.150.0000.01316.78
7.2.140.0070.01016.79
7.2.130.0070.00716.98
7.2.120.0000.00916.86
7.2.110.0030.01217.00
7.2.100.0040.01217.11
7.2.90.0030.01317.03
7.2.80.0120.00616.87
7.2.70.0070.00317.05
7.2.60.0040.01116.88
7.2.50.0100.00717.02
7.2.40.0030.01017.07
7.2.30.0120.00616.88
7.2.20.0060.01316.76
7.2.10.0070.01016.88
7.2.00.0070.00718.27
7.1.330.0000.01515.92
7.1.320.0100.00615.61
7.1.310.0000.01115.71
7.1.300.0030.01015.66
7.1.290.0000.01315.59
7.1.280.0080.00315.74
7.1.270.0040.00415.61
7.1.260.0070.00715.61
7.1.250.0030.00916.02
7.1.240.0070.00715.93
7.1.230.0100.00615.74
7.1.220.0080.00415.92
7.1.210.0070.00315.73
7.1.200.0030.01015.84
7.1.190.0000.01315.77
7.1.180.0060.00315.76
7.1.170.0060.00615.86
7.1.160.0030.01215.56
7.1.150.0070.00715.88
7.1.140.0060.01215.80
7.1.130.0040.01115.65
7.1.120.0040.01115.88
7.1.110.0100.00715.94
7.1.100.0070.00715.86
7.1.90.0000.01016.00
7.1.80.0030.01215.86
7.1.70.0020.00916.40
7.1.60.0050.01317.58
7.1.50.0060.01116.45
7.1.40.0000.01016.00
7.1.30.0000.01315.76
7.1.20.0040.00715.59
7.1.10.0070.00715.76
7.1.00.0090.02119.18
7.0.330.0050.00515.43
7.0.320.0000.01415.15
7.0.310.0070.00715.52
7.0.300.0090.00615.44
7.0.290.0090.00615.44
7.0.280.0100.00715.54
7.0.270.0120.00315.66
7.0.260.0070.01015.44
7.0.250.0060.00615.59
7.0.240.0060.00615.56
7.0.230.0030.00615.59
7.0.220.0060.00615.22
7.0.210.0060.00715.51
7.0.200.0090.00216.14
7.0.190.0030.00615.59
7.0.180.0000.01315.60
7.0.170.0080.00615.61
7.0.160.0100.00615.57
7.0.150.0100.00615.56
7.0.140.0000.04118.85
7.0.130.0000.01215.34
7.0.120.0030.04318.68
7.0.110.0090.00915.46
7.0.100.0090.00015.12
7.0.90.0000.01015.53
7.0.80.0060.00615.56
7.0.70.0050.00515.42
7.0.60.0030.03317.62
7.0.50.0110.03616.74
7.0.40.0180.02316.87
7.0.30.0240.03716.87
7.0.20.0170.02316.74
7.0.10.0220.04316.82
7.0.00.0210.02016.71
5.6.400.0090.00614.48
5.6.390.0130.00314.54
5.6.380.0060.00914.57
5.6.370.0030.00714.63
5.6.360.0080.00414.61
5.6.350.0030.00914.68
5.6.340.0040.01114.45
5.6.330.0080.00314.70
5.6.320.0030.01014.43
5.6.310.0040.00814.59
5.6.300.0030.00614.47
5.6.290.0070.00314.66
5.6.280.0020.04517.84
5.6.270.0030.01314.73
5.6.260.0050.00814.55
5.6.250.0040.01414.45
5.6.240.0110.00014.38
5.6.230.0040.00814.60
5.6.220.0030.00614.45
5.6.210.0030.02517.48
5.6.200.0080.04016.41
5.6.190.0220.04317.45
5.6.180.0170.04617.51
5.6.170.0220.04217.39
5.6.160.0130.03017.47
5.6.150.0210.03517.45
5.6.140.0260.02717.48
5.6.130.0170.02617.43
5.6.120.0230.04317.31
5.6.110.0150.04517.30
5.6.100.0320.03717.35
5.6.90.0200.03217.54
5.6.80.0200.04117.07
5.6.70.0180.02617.12
5.6.60.0200.03517.01
5.6.50.0200.03617.19
5.6.40.0220.03917.11
5.6.30.0220.03916.99
5.6.20.0220.03916.87
5.6.10.0130.02817.14
5.6.00.0140.02717.12
5.5.380.0060.00314.28
5.5.370.0080.00414.49
5.5.360.0000.01214.61
5.5.350.0190.02417.60
5.5.340.0050.02416.27
5.5.330.0100.02917.37
5.5.320.0170.04117.44
5.5.310.0160.03117.42
5.5.300.0130.03517.12
5.5.290.0180.02817.37
5.5.280.0200.04517.25
5.5.270.0140.03117.12
5.5.260.0210.02517.19
5.5.250.0150.02916.85
5.5.240.0150.03016.81
5.5.230.0220.03716.98
5.5.220.0200.03317.01
5.5.210.0180.04316.95
5.5.200.0170.04316.97
5.5.190.0170.04216.81
5.5.180.0150.02816.96
5.5.170.0030.01014.25
5.5.160.0220.03816.91
5.5.150.0200.03616.94
5.5.140.0130.04717.06
5.5.130.0200.02816.77
5.5.120.0180.03816.95
5.5.110.0230.03016.84
5.5.100.0150.04716.88
5.5.90.0190.02116.98
5.5.80.0200.03717.05
5.5.70.0230.03716.85
5.5.60.0220.03816.71
5.5.50.0180.03816.77
5.5.40.0150.02516.85
5.5.30.0140.04616.73
5.5.20.0210.04116.72
5.5.10.0130.02916.85
5.5.00.0170.02016.67
5.4.450.0230.03615.34
5.4.440.0220.03815.31
5.4.430.0170.02215.29
5.4.420.0170.03815.32
5.4.410.0170.02715.30
5.4.400.0180.03814.98
5.4.390.0160.03215.12
5.4.380.0180.03815.13
5.4.370.0170.03915.04
5.4.360.0120.03615.08
5.4.350.0170.02215.23
5.4.340.0170.02315.09
5.4.330.0030.01011.30
5.4.320.0150.03815.17
5.4.310.0200.03415.10
5.4.300.0130.02914.98
5.4.290.0170.03715.16
5.4.280.0180.03715.02
5.4.270.0160.02615.27
5.4.260.0150.04215.23
5.4.250.0220.02015.34
5.4.240.0190.03715.11
5.4.230.0200.03715.03
5.4.220.0170.03815.11
5.4.210.0240.03315.30
5.4.200.0150.02914.99
5.4.190.0170.03915.12
5.4.180.0150.03814.97
5.4.170.0130.02515.06
5.4.160.0120.02815.05
5.4.150.0080.02715.13
5.4.140.0120.02313.76
5.4.130.0200.03613.88
5.4.120.0130.03613.94
5.4.110.0170.03213.89
5.4.100.0130.02213.91
5.4.90.0140.02213.81
5.4.80.0150.02113.95
5.4.70.0130.03513.69
5.4.60.0100.02313.82
5.4.50.0150.02113.78
5.4.40.0170.02713.74
5.4.30.0130.02013.82
5.4.20.0180.02213.71
5.4.10.0200.03713.99
5.4.00.0150.02913.46
5.3.290.0170.04112.87
5.3.280.0200.03312.86
5.3.270.0170.02012.80
5.3.260.0120.02212.85
5.3.250.0120.02512.85
5.3.240.0130.03812.86
5.3.230.0150.04412.84
5.3.220.0130.02512.84
5.3.210.0130.02312.83
5.3.200.0150.02412.77
5.3.190.0160.03812.78
5.3.180.0200.02812.85
5.3.170.0120.02612.85
5.3.160.0160.02612.83
5.3.150.0180.03712.78
5.3.140.0180.03512.86
5.3.130.0130.03512.81
5.3.120.0140.02512.84
5.3.110.0180.02912.81
5.3.100.0180.03312.56
5.3.90.0150.02012.62
5.3.80.0100.02312.58
5.3.70.0150.04012.57
5.3.60.0190.02112.53
5.3.50.0130.02312.47
5.3.40.0170.02012.46
5.3.30.0190.03512.44
5.3.20.0240.02812.35
5.3.10.0150.03812.37
5.3.00.0130.03612.38
5.2.170.0170.03312.32
5.2.160.0170.03012.32
5.2.150.0230.04012.32
5.2.140.0200.05712.32
5.2.130.0330.05312.32
5.2.120.0230.06312.32
5.2.110.0300.05312.32
5.2.100.0200.04312.32
5.2.90.0170.03312.32
5.2.80.0230.06012.32
5.2.70.0200.05012.32
5.2.60.0200.06712.32
5.2.50.0170.03712.32
5.2.40.0170.05712.32
5.2.30.0170.06012.32
5.2.20.0170.06012.32
5.2.10.0230.04312.32
5.2.00.0170.04312.32
5.1.60.0100.03012.32
5.1.50.0270.04012.32
5.1.40.0170.04712.32
5.1.30.0170.03712.32
5.1.20.0230.04012.32
5.1.10.0200.03712.32
5.1.00.0170.02712.32
5.0.50.0130.04312.32
5.0.40.0170.03712.32
5.0.30.0130.05712.32
5.0.20.0130.02712.32
5.0.10.0170.03712.32
5.0.00.0130.04712.32
4.4.90.0100.03712.32
4.4.80.0100.03012.32
4.4.70.0100.02012.32
4.4.60.0130.03312.32
4.4.50.0070.03012.32
4.4.40.0070.05712.32
4.4.30.0100.03712.32
4.4.20.0070.03712.32
4.4.10.0130.03312.32
4.4.00.0070.05012.32
4.3.110.0130.02012.32
4.3.100.0100.03712.32
4.3.90.0100.03712.32
4.3.80.0100.04312.32
4.3.70.0170.02012.32
4.3.60.0070.03712.32
4.3.50.0070.02712.32
4.3.40.0070.04012.32
4.3.30.0000.02712.32
4.3.20.0030.02012.32
4.3.10.0030.03312.32
4.3.00.0030.03712.32

preferences:
32.74 ms | 400 KiB | 5 Q