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{ 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.0080.01115.11
7.4.00.0090.00915.06
7.3.130.0100.00714.86
7.3.120.0130.00614.73
7.3.110.0110.00614.91
7.3.100.0030.00915.04
7.3.90.0030.01114.84
7.3.80.0070.00714.90
7.3.70.0040.00914.79
7.3.60.0040.01114.92
7.3.50.0030.00914.92
7.3.40.0040.00814.75
7.3.30.0050.00914.94
7.3.20.0090.00516.81
7.3.10.0100.00216.72
7.3.00.0020.01416.66
7.2.260.0160.00315.30
7.2.250.0060.01015.34
7.2.240.0090.00815.34
7.2.230.0070.00615.10
7.2.220.0080.00715.10
7.2.210.0020.01415.26
7.2.200.0030.00915.09
7.2.190.0020.01215.14
7.2.180.0030.01115.13
7.2.170.0090.00515.17
7.2.160.0060.00615.17
7.2.150.0040.00717.03
7.2.140.0100.00716.91
7.2.130.0040.01117.02
7.2.120.0030.01017.02
7.2.110.0060.00917.06
7.2.100.0030.00616.59
7.2.90.0030.00617.09
7.2.80.0030.01217.05
7.2.70.0120.00416.89
7.2.60.0030.01716.94
7.2.50.0040.00717.13
7.2.40.0120.00616.90
7.2.30.0100.01016.95
7.2.20.0030.01016.59
7.2.10.0040.01116.73
7.2.00.0080.01018.25
7.1.330.0030.01215.78
7.1.320.0050.01115.68
7.1.310.0050.00515.82
7.1.300.0060.00915.65
7.1.290.0090.00215.71
7.1.280.0060.00715.69
7.1.270.0070.00615.88
7.1.260.0080.00515.83
7.1.250.0040.00415.57
7.1.240.0100.00315.77
7.1.230.0030.00615.61
7.1.220.0000.01515.58
7.1.210.0080.00615.91
7.1.200.0060.01215.83
7.1.190.0060.01315.86
7.1.180.0030.01215.97
7.1.170.0080.00015.66
7.1.160.0030.01115.62
7.1.150.0060.01015.82
7.1.140.0040.00715.60
7.1.130.0070.01015.79
7.1.120.0070.01115.79
7.1.110.0070.00415.58
7.1.100.0080.00615.98
7.1.90.0000.01715.84
7.1.80.0030.01015.86
7.1.70.0080.00516.53
7.1.60.0100.00817.55
7.1.50.0090.00916.36
7.1.40.0040.00415.94
7.1.30.0100.00316.01
7.1.20.0040.00815.87
7.1.10.0120.00415.69
7.1.00.0050.02819.01
7.0.330.0030.00715.51
7.0.320.0100.00315.34
7.0.310.0030.00915.36
7.0.300.0060.00315.18
7.0.290.0030.00715.47
7.0.280.0030.00915.35
7.0.270.0080.00915.50
7.0.260.0040.01415.30
7.0.250.0000.00915.61
7.0.240.0100.00315.50
7.0.230.0030.01015.27
7.0.220.0100.00315.47
7.0.210.0040.00715.62
7.0.200.0030.00616.21
7.0.190.0030.01015.54
7.0.180.0030.00715.57
7.0.170.0030.00615.67
7.0.160.0000.01315.10
7.0.150.0000.01615.24
7.0.140.0050.03818.72
7.0.130.0080.00415.63
7.0.120.0030.01015.39
7.0.110.0040.01115.34
7.0.100.0080.00415.34
7.0.90.0030.00615.57
7.0.80.0000.01615.53
7.0.70.0010.02418.68
7.0.60.0040.02418.62
7.0.50.0050.03518.85
7.0.40.0030.02516.72
7.0.30.0040.02116.79
7.0.20.0070.02216.79
7.0.10.0060.02116.77
7.0.00.0050.02216.85
5.6.400.0030.01014.53
5.6.390.0060.00314.80
5.6.380.0040.00814.52
5.6.370.0070.00714.61
5.6.360.0110.00414.80
5.6.350.0060.01314.44
5.6.340.0070.00714.56
5.6.330.0000.01614.69
5.6.320.0090.00614.27
5.6.310.0040.00714.57
5.6.300.0060.01014.29
5.6.290.0070.00714.65
5.6.280.0030.04217.72
5.6.270.0030.00614.46
5.6.260.0040.01414.47
5.6.250.0090.00614.62
5.6.240.0000.01414.66
5.6.230.0030.01314.40
5.6.220.0030.02517.48
5.6.210.0050.02517.46
5.6.200.0050.02917.80
5.6.190.0010.04617.92
5.6.180.0050.02417.88
5.6.170.0070.02317.89
5.6.160.0020.02617.67
5.6.150.0050.02517.75
5.6.140.0030.02817.85
5.6.130.0000.03317.76
5.6.120.0050.02317.82
5.6.110.0030.02617.79
5.6.100.0050.02517.69
5.6.90.0040.02617.64
5.6.80.0050.02517.28
5.6.70.0030.02717.26
5.6.60.0060.02117.49
5.6.50.0000.03617.30
5.6.40.0050.04117.42
5.6.30.0080.04017.46
5.6.20.0050.04617.35
5.6.10.0050.04317.38
5.6.00.0070.03217.46
5.5.380.0030.00914.73
5.5.370.0070.00714.55
5.5.360.0110.02317.37
5.5.350.0020.02917.34
5.5.340.0080.02317.56
5.5.330.0040.02717.64
5.5.320.0110.02017.66
5.5.310.0080.03317.73
5.5.300.0050.02617.45
5.5.290.0080.02017.77
5.5.280.0070.02117.63
5.5.270.0060.02117.41
5.5.260.0020.02817.52
5.5.250.0050.02117.39
5.5.240.0000.02617.31
5.5.230.0030.02417.15
5.5.220.0030.02817.24
5.5.210.0050.02217.37
5.5.200.0080.04317.40
5.5.190.0100.04017.25
5.5.180.0020.03517.11
5.5.170.0050.00314.33
5.5.160.0080.02917.29
5.5.150.0100.04117.20
5.5.140.0020.04917.30
5.5.130.0000.03517.32
5.5.120.0060.04317.28
5.5.110.0070.03217.15
5.5.100.0070.04317.17
5.5.90.0000.03417.15
5.5.80.0030.02917.25
5.5.70.0040.02917.20
5.5.60.0080.02017.14
5.5.50.0100.03717.20
5.5.40.0030.04617.29
5.5.30.0020.02817.18
5.5.20.0050.03817.37
5.5.10.0100.03917.13
5.5.00.0080.03817.26
5.4.450.0040.02315.31
5.4.440.0050.02215.31
5.4.430.0030.03915.13
5.4.420.0050.02015.27
5.4.410.0030.02215.24
5.4.400.0000.02315.17
5.4.390.0020.02415.04
5.4.380.0070.02115.22
5.4.370.0020.01815.16
5.4.360.0070.04215.11
5.4.350.0050.04015.06
5.4.340.0030.03015.09
5.4.330.0030.00911.32
5.4.320.0060.02215.14
5.4.310.0050.04315.16
5.4.300.0070.03715.20
5.4.290.0020.04315.14
5.4.280.0050.04215.09
5.4.270.0020.04614.95
5.4.260.0030.04315.12
5.4.250.0050.04015.19
5.4.240.0090.03715.10
5.4.230.0020.04615.10
5.4.220.0050.04314.99
5.4.210.0060.04115.22
5.4.200.0060.04115.10
5.4.190.0070.04114.93
5.4.180.0020.04715.09
5.4.170.0100.02715.20
5.4.160.0050.03015.02
5.4.150.0040.04315.15
5.4.140.0020.02513.81
5.4.130.0000.04113.74
5.4.120.0040.02113.69
5.4.110.0000.02513.86
5.4.100.0020.02413.65
5.4.90.0050.01813.87
5.4.80.0050.03213.81
5.4.70.0030.02413.90
5.4.60.0020.03113.78
5.4.50.0070.03813.72
5.4.40.0020.03413.80
5.4.30.0000.02113.81
5.4.20.0050.03513.61
5.4.10.0030.04213.88
5.4.00.0030.04113.60
5.3.290.0020.04512.77
5.3.280.0040.02912.69
5.3.270.0050.03812.67
5.3.260.0030.03912.67
5.3.250.0040.04012.67
5.3.240.0060.03912.75
5.3.230.0010.03912.76
5.3.220.0030.02312.69
5.3.210.0000.03612.76
5.3.200.0050.03812.73
5.3.190.0030.03312.74
5.3.180.0010.04112.65
5.3.170.0030.02512.69
5.3.160.0030.02612.71
5.3.150.0020.04012.73
5.3.140.0050.03712.75
5.3.130.0030.03712.71
5.3.120.0020.04212.67
5.3.110.0050.02912.69
5.3.100.0020.04012.42
5.3.90.0060.03612.44
5.3.80.0060.03812.44
5.3.70.0090.02512.46
5.3.60.0070.03912.43
5.3.50.0010.03912.34
5.3.40.0020.02312.39
5.3.30.0040.04012.37
5.3.20.0010.02912.30
5.3.10.0000.02412.28
5.3.00.0030.02012.19
5.2.170.0030.05012.36
5.2.160.0030.03312.36
5.2.150.0030.06012.36
5.2.140.0030.06312.36
5.2.130.0000.04312.36
5.2.120.0000.06012.36
5.2.110.0030.05012.36
5.2.100.0030.06012.36
5.2.90.0070.06012.36
5.2.80.0030.06312.36
5.2.70.0030.06712.36
5.2.60.0000.06312.36
5.2.50.0030.06712.36
5.2.40.0000.06312.36
5.2.30.0000.06012.36
5.2.20.0100.05312.36
5.2.10.0030.06012.36
5.2.00.0000.06312.36
5.1.60.0000.05712.36
5.1.50.0000.02712.36
5.1.40.0000.02712.36
5.1.30.0000.02712.36
5.1.20.0070.02012.36
5.1.10.0000.04312.36
5.1.00.0030.04712.36
5.0.50.0030.04712.36
5.0.40.0000.04312.36
5.0.30.0000.05312.36
5.0.20.0000.04012.36
5.0.10.0030.04312.36
5.0.00.0070.06012.36
4.4.90.0000.02312.36
4.4.80.0000.01712.36
4.4.70.0000.03312.36
4.4.60.0070.02712.36
4.4.50.0000.03712.36
4.4.40.0000.03312.36
4.4.30.0000.01312.36
4.4.20.0030.03312.36
4.4.10.0000.02712.36
4.4.00.0030.04712.36
4.3.110.0070.02712.36
4.3.100.0070.02712.36
4.3.90.0000.02712.36
4.3.80.0000.05012.36
4.3.70.0030.02012.36
4.3.60.0000.03312.36
4.3.50.0100.02712.36
4.3.40.0000.05012.36
4.3.30.0030.03712.36
4.3.20.0000.03012.36
4.3.10.0000.02012.36
4.3.00.0030.03312.36

preferences:
41.11 ms | 400 KiB | 5 Q