3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month=10; $year=2014; // Mantech $startDate = strtotime($month.'/1/'.$year); $stopDate = strtotime('last day of this month ',$startDate); if (date('D',$startDate)!='Sat'){ $startDate = strtotime('next saturday',$startDate); } if (date('D',$stopDate)!='Fri'){ $stopDate = strtotime('next friday',$stopDate); } echo (date('Y-m-d',$startDate).' - '.date('Y-m-d',$stopDate)."\n"); // If our startDate isn't a Monday, grab the previous Monday if (date('D',$startDate)!='Mon'){ $prevMonday = strtotime('last Monday',$startDate); } else { $prevMonday = $startDate; } // Format startweek as ISO8601 eg.2014W15 echo (date('Y-m-d',$prevMonday)."\n"); $beginWeek = date('o',$prevMonday).'W'.date('W',$prevMonday); echo ($beginWeek."\n"); echo (date('Y-m-d',strtotime($beginWeek))."\n"); $datediff=$stopDate-$startDate; $weeks=ceil($datediff/(60*60*24*7)); echo ($weeks."\n"); for ($i=0; $i<=$weeks; $i++){ $thisWeek = strtotime($beginWeek.' +'.$i.' weeks'); echo (date('Y-m-d',$thisWeek)."\n"); $mask = ''; for ($j=0; $j<7; $j++){ $thisDay = strtotime('+'.$j.' days',$thisWeek); echo (date('Y-m-d',$thisDay)."\n"); if ($startDate<=$thisDay or $thisDay<=$stopDate){ $mask=$mask.'1'; } else { $mask=$mask.'0'; } } echo $mask."\n"; }

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)
8.3.60.0180.00418.30
8.3.50.0070.00921.97
8.3.40.0110.00719.09
8.3.30.0180.00319.13
8.3.20.0050.00320.49
8.3.10.0050.00323.66
8.3.00.0080.00019.19
8.2.180.0070.00716.88
8.2.170.0070.01422.96
8.2.160.0120.00320.55
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.98
8.2.110.0050.00522.38
8.2.100.0030.01019.88
8.2.90.0030.00519.33
8.2.80.0000.00817.97
8.2.70.0060.00317.88
8.2.60.0060.00318.04
8.2.50.0060.00618.07
8.2.40.0060.00320.16
8.2.30.0040.00418.48
8.2.20.0080.00018.03
8.2.10.0030.00618.26
8.2.00.0030.00617.98
8.1.280.0140.00325.92
8.1.270.0040.01224.05
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0100.00723.82
8.1.230.0000.01119.27
8.1.220.0040.00417.91
8.1.210.0030.00518.77
8.1.200.0040.00717.73
8.1.190.0080.00017.60
8.1.180.0000.00918.10
8.1.170.0040.00418.96
8.1.160.0060.00322.09
8.1.150.0040.00418.87
8.1.140.0000.00717.65
8.1.130.0070.00017.96
8.1.120.0030.00617.82
8.1.110.0000.00717.82
8.1.100.0000.00817.81
8.1.90.0050.00317.85
8.1.80.0080.00017.88
8.1.70.0000.00717.69
8.1.60.0000.01017.87
8.1.50.0040.00417.83
8.1.40.0030.00617.68
8.1.30.0030.00617.89
8.1.20.0040.00417.96
8.1.10.0000.00717.77
8.1.00.0040.00417.77
8.0.300.0040.00418.77
8.0.290.0020.00517.28
8.0.280.0000.00818.67
8.0.270.0050.00217.52
8.0.260.0070.00017.45
8.0.250.0040.00417.20
8.0.240.0000.00717.33
8.0.230.0000.00717.20
8.0.220.0040.00417.11
8.0.210.0070.00017.15
8.0.200.0030.00317.36
8.0.190.0000.00817.20
8.0.180.0040.00417.09
8.0.170.0030.00617.27
8.0.160.0000.00817.24
8.0.150.0050.00317.27
8.0.140.0000.00717.24
8.0.130.0030.00313.57
8.0.120.0040.00417.20
8.0.110.0050.00317.14
8.0.100.0000.00717.14
8.0.90.0000.00717.13
8.0.80.0090.00617.16
8.0.70.0050.00217.31
8.0.60.0050.00217.07
8.0.50.0030.00517.11
8.0.30.0070.02017.46
8.0.20.0090.01017.43
8.0.10.0040.00417.25
8.0.00.0090.01017.23
7.4.330.0050.00015.00
7.4.320.0030.00716.81
7.4.300.0000.00616.84
7.4.290.0000.00816.78
7.4.280.0000.00816.83
7.4.270.0000.00716.89
7.4.260.0070.00016.88
7.4.250.0000.00816.74
7.4.240.0020.00616.88
7.4.230.0050.00316.70
7.4.220.0080.01116.75
7.4.210.0090.00916.92
7.4.200.0050.00316.89
7.4.190.0070.00016.80
7.4.160.0110.00616.77
7.4.150.0060.01617.40
7.4.140.0080.01017.86
7.4.130.0110.00816.87
7.4.120.0040.01516.80
7.4.110.0040.01616.82
7.4.100.0080.01016.64
7.4.90.0030.01416.91
7.4.80.0120.00619.39
7.4.70.0140.00316.86
7.4.60.0090.01216.83
7.4.50.0000.00616.72
7.4.40.0110.00716.88
7.4.30.0100.01317.00
7.4.00.0120.00615.29
7.3.330.0030.00313.37
7.3.320.0000.00513.32
7.3.310.0000.00716.57
7.3.300.0030.00316.63
7.3.290.0060.01316.60
7.3.280.0120.00916.61
7.3.270.0070.01517.40
7.3.260.0130.00716.94
7.3.250.0060.01416.75
7.3.240.0070.01116.86
7.3.230.0140.00316.81
7.3.210.0100.01416.67
7.3.200.0120.01219.39
7.3.190.0060.01116.67
7.3.180.0000.01816.74
7.3.170.0150.00816.71
7.3.160.0110.00816.69
7.3.120.0100.00615.09
7.2.330.0070.01016.80
7.2.320.0060.01616.77
7.2.310.0040.01317.09
7.2.300.0070.01017.03
7.2.290.0130.01017.10
7.1.70.0040.00717.50
7.1.60.0140.01019.70
7.1.50.0110.01417.29
7.1.00.0070.07322.54
7.0.200.0040.00715.33
7.0.140.0030.07322.12
7.0.100.0130.07319.93
7.0.90.0400.08320.00
7.0.80.0530.05019.99
7.0.70.0330.07719.88
7.0.60.0400.07320.02
7.0.50.0200.07320.34
7.0.40.0000.05020.01
7.0.30.0030.08320.18
7.0.20.0200.08020.15
7.0.10.0070.06320.12
7.0.00.0070.05020.12
5.6.280.0030.07020.88
5.6.250.0200.07020.58
5.6.240.0100.04720.63
5.6.230.0170.07320.67
5.6.220.0100.07720.50
5.6.210.0100.08320.65
5.6.200.0130.05321.13
5.6.190.0070.08721.12
5.6.180.0100.08321.04
5.6.170.0100.08021.07
5.6.160.0030.05321.09
5.6.150.0100.03721.12
5.6.140.0070.04021.05
5.6.130.0100.03721.04
5.6.120.0070.05721.07
5.6.110.0100.04321.09
5.6.100.0070.08021.02
5.6.90.0070.06320.94
5.6.80.0100.06320.47
5.6.70.0130.07720.49
5.6.60.0070.07320.46
5.6.50.0000.05320.45
5.6.40.0070.06720.40
5.6.30.0030.08720.43
5.6.20.0000.04720.39
5.6.10.0170.06020.38
5.6.00.0170.04020.37
5.5.380.0070.04320.51
5.5.370.0130.06720.36
5.5.360.0070.07320.38
5.5.350.0000.06020.39
5.5.340.0070.05020.93
5.5.330.0070.04320.90
5.5.320.0000.07020.91
5.5.310.0100.06720.82
5.5.300.0070.04320.66
5.5.290.0230.03320.81
5.5.280.0000.06320.85
5.5.270.0000.09020.92
5.5.260.0030.04720.92
5.5.250.0070.07020.75
5.5.240.0070.04320.30
5.5.230.0130.07320.14
5.5.220.0030.06020.25
5.5.210.0130.03320.16
5.5.200.0030.04320.29
5.5.190.0130.04720.14
5.5.180.0030.04720.15
5.5.160.0030.04320.22
5.5.150.0070.04020.26
5.5.140.0070.04020.12
5.5.130.0100.04020.26
5.5.120.0030.05020.19
5.5.110.0030.04720.09
5.5.100.0130.07319.97
5.5.90.0100.08020.12
5.5.80.0170.07720.04
5.5.70.0030.06720.08
5.5.60.0070.07720.09
5.5.50.0130.06720.07
5.5.40.0000.04720.07
5.5.30.0070.07019.95
5.5.20.0100.06720.09
5.5.10.0070.04320.06
5.5.00.0070.06320.13
5.4.450.0100.07719.48
5.4.440.0070.05319.27
5.4.430.0030.04319.14
5.4.420.0070.07719.21
5.4.410.0030.04319.34
5.4.400.0070.08018.95
5.4.390.0230.06319.12
5.4.380.0070.06319.14
5.4.370.0000.04719.02
5.4.360.0100.05719.13
5.4.350.0030.08019.07
5.4.340.0070.06319.04
5.4.320.0030.06719.12
5.4.310.0030.04018.98
5.4.300.0130.06019.02
5.4.290.0030.05018.82
5.4.280.0130.07019.07
5.4.270.0100.06719.22
5.4.260.0100.07719.02
5.4.250.0070.07319.05
5.4.240.0000.05018.89
5.4.230.0030.07718.96
5.4.220.0030.08019.01
5.4.210.0070.05718.97
5.4.200.0070.07319.04
5.4.190.0030.05319.02
5.4.180.0070.04019.09
5.4.170.0070.07319.08
5.4.160.0030.04319.05
5.4.150.0100.07319.20
5.4.140.0100.04316.29
5.4.130.0130.07016.28
5.4.120.0100.03016.25
5.4.110.0130.05016.26
5.4.100.0030.05016.43
5.4.90.0100.05016.42
5.4.80.0030.07016.25
5.4.70.0070.07316.44
5.4.60.0100.05316.30
5.4.50.0030.03716.35
5.4.40.0100.07016.43
5.4.30.0070.05716.39
5.4.20.0030.05316.27
5.4.10.0000.05316.30
5.4.00.0100.04015.66
5.3.290.0030.04314.54
5.3.280.0070.08014.45
5.3.270.0070.07714.57
5.3.260.0100.07314.56
5.3.250.0030.05714.60
5.3.240.0070.05714.48
5.3.230.0070.08014.56
5.3.220.0100.05314.45
5.3.210.0130.07314.40
5.3.200.0030.04014.54
5.3.190.0030.04714.44
5.3.180.0100.05314.54
5.3.170.0030.04014.53
5.3.160.0070.07714.41
5.3.150.0170.04014.44
5.3.140.0100.07714.39
5.3.130.0100.06714.52
5.3.120.0000.06314.44
5.3.110.0070.05314.42
5.3.100.0030.05013.89
5.3.90.0000.04713.86
5.3.80.0100.06714.03
5.3.70.0230.03013.90
5.3.60.0070.03714.00
5.3.50.0070.03713.95
5.3.40.0030.07013.73
5.3.30.0130.03313.78
5.3.20.0030.04713.68
5.3.10.0070.05713.43
5.3.00.0070.03313.63
5.2.170.0000.03711.26
5.2.160.0030.06711.26
5.2.150.0030.05711.26
5.2.140.0170.03711.26
5.2.130.0030.03711.26
5.2.120.0100.05311.26
5.2.110.0100.05311.26
5.2.100.0000.03011.26
5.2.90.0030.05311.26
5.2.80.0070.02011.26
5.2.70.0000.03711.26
5.2.60.0100.02011.26
5.2.50.0100.02011.26
5.2.40.0030.05311.26
5.2.30.0030.03011.26
5.2.20.0000.04011.26
5.2.10.0070.02711.26
5.2.00.0030.06011.26
5.1.60.0100.02711.26
5.1.50.0000.02311.26
5.1.40.0070.04311.26
5.1.30.0000.06011.26
5.1.20.0170.04311.26
5.1.10.0070.03311.26
5.1.00.0070.04311.26
5.0.50.0000.02011.26
5.0.40.0070.04311.26
5.0.30.0070.05311.26
5.0.20.0100.03311.26
5.0.10.0000.02011.26
5.0.00.0030.06011.26
4.4.90.0000.03311.26
4.4.80.0070.01011.26
4.4.70.0000.01711.26
4.4.60.0000.01711.26
4.4.50.0070.01011.26
4.4.40.0030.05011.26
4.4.30.0030.02311.26
4.4.20.0000.03011.26
4.4.10.0000.03711.26
4.4.00.0000.03011.26
4.3.110.0070.02711.26
4.3.100.0030.02311.26
4.3.90.0000.01711.26
4.3.80.0000.03311.26
4.3.70.0070.03311.26
4.3.60.0030.03311.26
4.3.50.0030.03011.26
4.3.40.0030.05311.26
4.3.30.0030.01311.26
4.3.20.0070.01311.26
4.3.10.0000.01711.26
4.3.00.0000.01711.26

preferences:
38.26 ms | 401 KiB | 5 Q