3v4l.org

run code in 300+ PHP versions simultaneously
<?php class day{ public $date; public function __construct() { $this->date = time(); } /** * Should I write code today? * @param (array) $todos Current list of TODOs * @return boolean I should code if true. */ public function doCode($todos) { //return true; //Never stop coding $chore = next($todos); while($chore && $chore->priority < 3 ) $chore = next($todos); return $chore === false; } /** * Is the date in teh weekend? * @param string $date String date to check * @return boolean True if date is in the weekend */ protected function isWeekend($date) { return date('w', strtotime($date)) % 6 == 0; } } /* End of file day.php */ /* Location: ./life/modules/day/day.php */ $agenda = array( (object)array('priority'=>1) ,(object)array('priority'=>1) ,(object)array('priority'=>1) ,(object)array('priority'=>1) ); $day = new day(); $i = 1; while($i< 10) { echo var_dump($day->doCode($agenda)) . "\n"; $day->date = strtotime($day->date. ' + 1 days'); $i++; }

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.3.120.0060.00917.15
7.3.110.0130.00317.15
7.3.100.0070.00717.15
7.3.90.0090.00617.15
7.3.80.0080.00817.15
7.3.70.0040.01117.15
7.3.60.0100.00317.15
7.3.50.0090.00617.15
7.3.40.0070.01017.15
7.3.30.0060.00917.15
7.3.20.0030.01017.15
7.3.10.0040.01116.86
7.3.00.0080.00816.95
7.2.240.0100.00717.15
7.2.230.0030.01417.15
7.2.220.0000.01517.15
7.2.210.0040.01117.15
7.2.200.0030.01417.15
7.2.190.0090.00917.15
7.2.180.0070.01117.15
7.2.170.0060.00917.15
7.2.160.0000.01417.15
7.2.150.0040.00817.29
7.2.140.0120.00417.19
7.2.130.0100.00517.00
7.2.120.0060.01117.05
7.2.110.0050.01217.13
7.2.100.0070.01016.99
7.2.90.0090.00717.21
7.2.80.0090.00817.17
7.2.70.0090.00917.25
7.2.60.0100.01017.07
7.2.50.0050.01216.95
7.2.40.0040.00917.19
7.2.30.0100.00517.11
7.2.20.0070.00717.25
7.2.10.0100.00317.23
7.2.00.0060.00918.06
7.1.330.0070.00417.15
7.1.320.0090.00917.15
7.1.310.0000.01617.15
7.1.300.0000.01617.15
7.1.290.0000.01617.15
7.1.280.0060.00617.15
7.1.270.0100.00317.15
7.1.260.0040.01117.15
7.1.250.0130.00516.56
7.1.100.0070.00318.43
7.1.70.0050.00317.53
7.1.60.0040.01819.17
7.1.50.0150.00917.20
7.1.00.0030.03322.57
7.0.200.0040.00416.83
7.0.140.0100.07022.04
7.0.100.0070.04719.91
7.0.90.0100.08319.93
7.0.80.0100.08019.80
7.0.70.0530.08020.09
7.0.60.0630.06319.88
7.0.50.0600.06720.30
7.0.40.0030.07720.00
7.0.30.0100.07720.04
7.0.20.0030.05320.09
7.0.10.0070.04020.04
7.0.00.0100.08319.98
5.6.280.0000.07721.09
5.6.250.0100.05320.58
5.6.240.0130.08020.65
5.6.230.0100.08320.46
5.6.220.0130.07720.48
5.6.210.0200.06320.40
5.6.200.0100.08020.97
5.6.190.0070.07720.99
5.6.180.0170.06720.98
5.6.170.0070.04720.98
5.6.160.0130.06720.93
5.6.150.0170.07320.98
5.6.140.0130.07720.99
5.6.130.0100.05720.99
5.6.120.0030.07020.96
5.6.110.0100.08321.01
5.6.100.0170.07721.00
5.6.90.0100.06020.98
5.6.80.0130.07720.42
5.6.70.0200.07320.39
5.6.60.0170.05720.34
5.6.50.0200.07320.48
5.6.40.0070.08720.34
5.6.30.0100.07020.27
5.6.20.0030.07720.33
5.6.10.0070.08020.35
5.6.00.0070.04320.33
5.5.380.0070.07020.31
5.5.370.0100.06720.35
5.5.360.0070.08320.30
5.5.350.0100.08320.41
5.5.340.0030.07020.73
5.5.330.0100.05720.71
5.5.320.0030.07720.76
5.5.310.0130.07720.73
5.5.300.0130.06320.84
5.5.290.0100.08020.78
5.5.280.0100.08020.68
5.5.270.0070.05720.50
5.5.260.0000.08020.71
5.5.250.0030.08720.67
5.5.240.0130.07020.07
5.5.230.0070.07020.12
5.5.220.0070.08020.25
5.5.210.0170.03720.21
5.5.200.0070.08320.19
5.5.190.0030.08720.10
5.5.180.0030.06020.14
5.5.160.0200.05320.02
5.5.150.0030.04320.10
5.5.140.0100.03720.13
5.5.130.0070.06320.09
5.5.120.0030.05320.20
5.5.110.0230.06020.19
5.5.100.0170.07020.03
5.5.90.0030.08020.02
5.5.80.0170.07020.05
5.5.70.0000.09020.09
5.5.60.0100.08020.11
5.5.50.0030.08019.95
5.5.40.0130.07020.10
5.5.30.0100.07320.05
5.5.20.0130.07020.10
5.5.10.0030.08019.98
5.5.00.0070.06720.01
5.4.450.0000.07019.28
5.4.440.0030.08019.55
5.4.430.0030.08019.26
5.4.420.0030.07719.50
5.4.410.0100.05719.23
5.4.400.0030.08019.05
5.4.390.0130.06319.22
5.4.380.0000.07719.03
5.4.370.0030.08318.99
5.4.360.0030.08319.03
5.4.350.0000.08019.16
5.4.340.0230.05719.16
5.4.320.0230.06319.21
5.4.310.0070.05319.11
5.4.300.0070.08319.05
5.4.290.0000.05319.02
5.4.280.0070.05019.12
5.4.270.0100.07018.84
5.4.260.0030.05319.11
5.4.250.0070.07719.21
5.4.240.0170.06019.02
5.4.230.0000.08319.04
5.4.220.0000.08019.12
5.4.210.0070.07718.84
5.4.200.0100.07719.02
5.4.190.0030.07319.19
5.4.180.0070.07718.88
5.4.170.0000.04719.20
5.4.160.0170.06719.18
5.4.150.0130.05319.14
5.4.140.0070.03716.43
5.4.130.0030.03716.41
5.4.120.0030.07716.39
5.4.110.0100.03716.53
5.4.100.0070.03716.55
5.4.90.0130.06716.38
5.4.80.0070.04016.37
5.4.70.0070.06316.52
5.4.60.0070.07316.36
5.4.50.0070.06316.25
5.4.40.0030.07316.47
5.4.30.0070.05316.39
5.4.20.0130.07316.43
5.4.10.0100.03716.48
5.4.00.0170.05315.88
5.3.290.0070.05014.79
5.3.280.0070.08314.60
5.3.270.0030.04014.68
5.3.260.0100.05014.62
5.3.250.0130.04714.71
5.3.240.0100.05314.66
5.3.230.0030.07314.53
5.3.220.0100.08714.57
5.3.210.0030.08714.63
5.3.200.0070.04014.67
5.3.190.0170.05714.59
5.3.180.0100.03714.49
5.3.170.0130.07014.64
5.3.160.0100.07314.57
5.3.150.0030.07714.55
5.3.140.0070.08014.56
5.3.130.0070.05714.61
5.3.120.0070.03714.62
5.3.110.0100.07314.64
5.3.100.0070.07714.18
5.3.90.0130.06714.02
5.3.80.0100.06714.02
5.3.70.0130.08314.16
5.3.60.0130.06714.06
5.3.50.0100.07013.96
5.3.40.0030.08314.02
5.3.30.0070.07013.97
5.3.20.0000.06713.73
5.3.10.0100.07013.58
5.3.00.0030.07313.73
5.2.170.0030.06311.23
5.2.160.0100.06011.23
5.2.150.0030.06311.23
5.2.140.0000.06011.23
5.2.130.0030.05711.23
5.2.120.0000.07011.23
5.2.110.0100.06011.23
5.2.100.0100.04311.23
5.2.90.0030.04011.23
5.2.80.0030.07011.23
5.2.70.0070.05711.23
5.2.60.0070.04711.23
5.2.50.0070.06311.23
5.2.40.0030.04011.23
5.2.30.0070.06311.23
5.2.20.0030.04711.23
5.2.10.0100.05011.23
5.2.00.0070.05011.23
5.1.60.0100.05011.23
5.1.50.0030.05311.23
5.1.40.0030.05011.23
5.1.30.0130.05011.23
5.1.20.0130.04311.23
5.1.10.0030.05011.23
5.1.00.0030.05711.23
5.0.50.0070.02011.23
5.0.40.0030.04011.23
5.0.30.0070.05011.23
5.0.20.0000.04311.23
5.0.10.0030.03711.23
5.0.00.0000.05311.23
4.4.90.0030.03711.23
4.4.80.0000.03711.23
4.4.70.0030.03311.23
4.4.60.0030.02311.23
4.4.50.0070.03011.23
4.4.40.0030.05311.23
4.4.30.0070.02711.23
4.4.20.0100.02711.23
4.4.10.0000.02011.23
4.4.00.0130.04711.23
4.3.110.0000.02711.23
4.3.100.0030.03311.23
4.3.90.0030.03311.23
4.3.80.0030.03311.23
4.3.70.0000.03311.23
4.3.60.0070.03011.23
4.3.50.0000.03311.23
4.3.40.0000.05011.23
4.3.30.0100.03011.23
4.3.20.0000.03711.23
4.3.10.0000.03011.23
4.3.00.0000.03311.23

preferences:
37.85 ms | 401 KiB | 5 Q