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); 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.0090.00618.31
8.3.50.0170.00722.02
8.3.40.0070.01119.09
8.3.30.0110.00319.18
8.3.20.0000.00820.52
8.3.10.0040.00423.62
8.3.00.0000.00819.14
8.2.180.0060.00916.50
8.2.170.0140.00322.96
8.2.160.0100.00320.70
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00820.96
8.2.110.0090.00022.38
8.2.100.0060.00619.76
8.2.90.0040.00419.47
8.2.80.0040.00417.97
8.2.70.0000.00917.86
8.2.60.0040.00418.17
8.2.50.0090.00318.07
8.2.40.0060.00320.09
8.2.30.0030.00618.54
8.2.20.0000.00818.09
8.2.10.0040.00418.28
8.2.00.0060.00317.98
8.1.280.0140.00725.92
8.1.270.0110.00424.08
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00022.32
8.1.230.0040.00719.14
8.1.220.0040.00417.78
8.1.210.0030.00518.77
8.1.200.0080.00517.60
8.1.190.0060.00317.48
8.1.180.0060.00318.10
8.1.170.0050.00518.77
8.1.160.0000.00722.18
8.1.150.0050.00319.02
8.1.140.0000.00717.80
8.1.130.0040.00418.04
8.1.120.0030.00617.79
8.1.110.0050.00317.78
8.1.100.0000.00817.86
8.1.90.0030.00617.78
8.1.80.0020.00517.78
8.1.70.0000.00717.79
8.1.60.0070.00317.79
8.1.50.0000.00817.72
8.1.40.0030.00617.80
8.1.30.0030.00517.93
8.1.20.0080.00017.96
8.1.10.0000.00717.81
8.1.00.0050.00317.65
8.0.300.0080.00018.77
8.0.290.0080.00017.29
8.0.280.0040.00418.67
8.0.270.0030.00317.49
8.0.260.0000.00717.37
8.0.250.0030.00317.23
8.0.240.0070.00017.35
8.0.230.0070.00017.34
8.0.220.0000.00717.24
8.0.210.0050.00317.29
8.0.200.0050.00317.29
8.0.190.0000.00717.22
8.0.180.0080.00017.28
8.0.170.0040.00417.28
8.0.160.0040.00417.12
8.0.150.0070.00017.16
8.0.140.0000.00717.16
8.0.130.0060.00013.60
8.0.120.0050.00317.19
8.0.110.0030.00517.26
8.0.100.0040.00417.20
8.0.90.0080.00017.27
8.0.80.0030.01317.20
8.0.70.0000.00717.19
8.0.60.0040.00417.25
8.0.50.0040.00417.24
8.0.30.0190.00317.34
8.0.20.0090.01017.44
8.0.10.0000.00717.26
8.0.00.0110.00817.03
7.4.330.0050.00015.00
7.4.320.0030.00616.83
7.4.300.0030.00316.87
7.4.290.0050.00216.89
7.4.280.0030.00616.88
7.4.270.0020.00516.89
7.4.260.0040.00416.69
7.4.250.0000.00916.65
7.4.240.0020.00516.80
7.4.230.0000.00716.91
7.4.220.0040.01516.89
7.4.210.0080.00616.91
7.4.200.0040.00416.79
7.4.190.0030.00316.86
7.4.160.0100.00716.59
7.4.150.0070.01317.40
7.4.140.0080.01017.86
7.4.130.0130.00416.87
7.4.120.0070.01116.83
7.4.110.0240.00316.92
7.4.100.0140.00316.95
7.4.90.0080.01216.93
7.4.80.0040.01319.39
7.4.70.0080.00816.74
7.4.60.0150.00616.78
7.4.50.0000.00616.84
7.4.40.0070.01016.72
7.4.30.0150.00616.94
7.4.00.0100.00715.40
7.3.330.0000.00813.48
7.3.320.0050.00013.45
7.3.310.0000.00716.75
7.3.300.0030.00316.65
7.3.290.0040.01116.54
7.3.280.0090.01116.61
7.3.270.0090.00917.40
7.3.260.0110.00716.62
7.3.250.0110.00616.71
7.3.240.0140.00316.72
7.3.230.0040.01216.75
7.3.210.0060.01216.61
7.3.200.0150.00619.39
7.3.190.0120.00816.65
7.3.180.0130.00316.85
7.3.170.0080.01416.83
7.3.160.0060.01216.63
7.3.120.0070.01015.00
7.3.10.0030.00716.95
7.3.00.0090.00316.59
7.2.330.0030.01416.88
7.2.320.0180.00417.04
7.2.310.0110.00517.06
7.2.300.0080.00816.88
7.2.290.0120.01117.08
7.2.130.0060.00617.21
7.2.120.0070.00717.24
7.2.110.0030.01017.23
7.2.100.0030.00716.93
7.2.90.0070.00716.93
7.2.80.0130.00016.84
7.2.70.0080.00317.14
7.2.60.0070.00716.78
7.2.50.0070.00716.87
7.2.40.0040.00817.21
7.2.30.0030.01017.36
7.2.20.0030.01017.30
7.2.10.0030.00717.00
7.2.00.0090.00617.32
7.1.250.0030.00716.05
7.1.70.0030.00617.45
7.1.60.0060.01919.70
7.1.50.0140.01117.14
7.1.00.0000.08022.45
7.0.200.0160.00614.87
7.0.140.0130.06722.09
7.0.100.0370.05020.09
7.0.90.0400.07719.95
7.0.80.0230.05320.00
7.0.70.0400.08019.91
7.0.60.0400.08719.89
7.0.50.0370.08720.32
7.0.40.0030.04720.11
7.0.30.0130.08320.04
7.0.20.0200.04020.02
7.0.10.0100.08020.05
7.0.00.0000.07719.94
5.6.280.0130.06321.04
5.6.250.0200.07020.70
5.6.240.0100.04020.67
5.6.230.0100.07020.52
5.6.220.0070.08020.61
5.6.210.0100.08020.44
5.6.200.0070.08021.04
5.6.190.0100.08020.96
5.6.180.0100.07021.07
5.6.170.0130.08720.96
5.6.160.0030.04321.12
5.6.150.0070.06021.11
5.6.140.0100.08320.96
5.6.130.0000.05321.05
5.6.120.0100.05321.07
5.6.110.0100.07321.04
5.6.100.0100.07721.09
5.6.90.0130.04721.07
5.6.80.0070.07720.39
5.6.70.0030.08720.46
5.6.60.0070.04720.39
5.6.50.0070.08320.45
5.6.40.0030.07720.47
5.6.30.0170.08720.53
5.6.20.0070.06320.39
5.6.10.0100.07720.29
5.6.00.0070.08020.46
5.5.380.0100.07320.37
5.5.370.0070.08020.36
5.5.360.0030.08720.56
5.5.350.0070.04320.41
5.5.340.0030.06320.93
5.5.330.0070.04720.90
5.5.320.0070.08320.74
5.5.310.0030.04720.93
5.5.300.0000.07020.93
5.5.290.0100.08020.84
5.5.280.0170.06320.74
5.5.270.0100.06720.92
5.5.260.0100.04720.74
5.5.250.0170.07320.73
5.5.240.0130.08320.28
5.5.230.0030.04720.29
5.5.220.0030.08320.21
5.5.210.0130.05020.25
5.5.200.0070.07720.13
5.5.190.0100.05020.30
5.5.180.0130.08020.00
5.5.160.0130.07720.24
5.5.150.0030.08720.22
5.5.140.0130.07720.13
5.5.130.0130.06720.20
5.5.120.0130.03720.26
5.5.110.0130.07320.08
5.5.100.0070.07720.09
5.5.90.0170.06720.02
5.5.80.0170.05020.07
5.5.70.0100.05020.06
5.5.60.0130.07320.16
5.5.50.0070.07719.98
5.5.40.0030.08020.07
5.5.30.0070.04020.12
5.5.20.0070.08320.06
5.5.10.0130.07320.05
5.5.00.0130.07020.09
5.4.450.0070.07719.11
5.4.440.0070.08719.35
5.4.430.0130.05019.37
5.4.420.0130.06319.38
5.4.410.0100.07719.16
5.4.400.0000.08019.10
5.4.390.0170.06018.95
5.4.380.0030.07719.12
5.4.370.0100.06019.02
5.4.360.0100.07719.07
5.4.350.0030.08019.03
5.4.340.0070.08719.10
5.4.320.0100.07719.12
5.4.310.0000.05019.12
5.4.300.0100.07019.23
5.4.290.0030.08018.98
5.4.280.0070.07718.90
5.4.270.0030.06718.80
5.4.260.0170.06319.22
5.4.250.0070.05019.12
5.4.240.0130.03318.78
5.4.230.0070.07019.13
5.4.220.0000.08319.12
5.4.210.0130.06719.13
5.4.200.0070.05319.04
5.4.190.0030.04019.09
5.4.180.0130.06719.04
5.4.170.0100.06319.11
5.4.160.0070.05719.10
5.4.150.0030.04719.03
5.4.140.0000.05716.43
5.4.130.0070.04316.32
5.4.120.0030.07716.32
5.4.110.0170.05716.31
5.4.100.0070.08016.39
5.4.90.0100.06716.48
5.4.80.0130.06316.48
5.4.70.0030.05016.30
5.4.60.0030.03716.28
5.4.50.0000.04316.23
5.4.40.0030.03716.46
5.4.30.0030.04316.33
5.4.20.0100.03316.31
5.4.10.0030.03716.41
5.4.00.0030.03315.72
5.3.290.0070.07714.50
5.3.280.0100.07014.60
5.3.270.0130.03714.44
5.3.260.0070.08014.54
5.3.250.0030.03714.58
5.3.240.0100.06314.63
5.3.230.0030.08314.47
5.3.220.0030.06014.53
5.3.210.0070.04314.59
5.3.200.0070.07714.59
5.3.190.0070.04714.42
5.3.180.0070.07314.55
5.3.170.0130.06014.40
5.3.160.0070.03714.51
5.3.150.0070.03714.52
5.3.140.0030.03714.53
5.3.130.0030.04714.47
5.3.120.0000.04314.51
5.3.110.0070.05314.42
5.3.100.0000.04014.01
5.3.90.0070.03313.87
5.3.80.0030.03713.89
5.3.70.0100.04014.02
5.3.60.0030.03713.88
5.3.50.0000.04013.96
5.3.40.0100.03013.95
5.3.30.0100.04713.79
5.3.20.0070.07713.69
5.3.10.0030.04013.53
5.3.00.0070.03313.64
5.2.170.0000.03311.41
5.2.160.0070.02711.41
5.2.150.0030.03311.41
5.2.140.0030.03011.41
5.2.130.0000.03011.41
5.2.120.0030.04011.41
5.2.110.0030.02711.41
5.2.100.0070.02311.41
5.2.90.0100.02711.41
5.2.80.0030.03311.41
5.2.70.0000.03711.41
5.2.60.0000.03711.41
5.2.50.0030.02711.41
5.2.40.0030.03011.41
5.2.30.0030.05011.41
5.2.20.0070.03711.41
5.2.10.0030.02711.41
5.2.00.0000.03011.41
5.1.60.0000.02711.41
5.1.50.0000.02711.41
5.1.40.0000.02311.41
5.1.30.0000.02711.41
5.1.20.0000.03011.41
5.1.10.0030.03011.41
5.1.00.0000.03011.41
5.0.50.0000.02311.41
5.0.40.0000.02311.41
5.0.30.0000.03011.41
5.0.20.0000.02011.41
5.0.10.0000.02011.41
5.0.00.0030.02711.41
4.4.90.0070.01011.41
4.4.80.0000.02011.41
4.4.70.0000.01711.41
4.4.60.0170.00311.41
4.4.50.0000.02311.41
4.4.40.0030.04011.41
4.4.30.0030.01311.41
4.4.20.0070.01311.41
4.4.10.0000.01711.41
4.4.00.0070.02011.41
4.3.110.0030.01311.41
4.3.100.0000.01311.41
4.3.90.0000.01311.41
4.3.80.0030.02311.41
4.3.70.0030.01311.41
4.3.60.0030.03311.41
4.3.50.0000.02711.41
4.3.40.0000.02311.41
4.3.30.0000.02711.41
4.3.20.0000.02011.41
4.3.10.0000.01711.41
4.3.00.0000.01711.41

preferences:
38.88 ms | 401 KiB | 5 Q