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=floor($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.70.0070.00716.58
8.3.60.0030.01318.30
8.3.50.0060.01022.09
8.3.40.0120.00619.15
8.3.30.0080.00618.96
8.3.20.0050.00320.34
8.3.10.0040.00423.79
8.3.00.0040.00420.78
8.2.180.0090.00616.63
8.2.170.0170.00322.96
8.2.160.0040.01120.52
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0020.00526.16
8.2.120.0040.00421.02
8.2.110.0060.00322.43
8.2.100.0100.00319.88
8.2.90.0030.00519.53
8.2.80.0030.00517.97
8.2.70.0030.00717.88
8.2.60.0030.00618.15
8.2.50.0080.00318.07
8.2.40.0000.00820.03
8.2.30.0000.00718.53
8.2.20.0000.00818.03
8.2.10.0080.00018.36
8.2.00.0050.00518.11
8.1.280.0040.01125.92
8.1.270.0070.00724.14
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0040.00422.20
8.1.230.0040.00719.18
8.1.220.0080.00017.77
8.1.210.0060.00318.77
8.1.200.0100.01517.38
8.1.190.0060.00317.60
8.1.180.0040.00418.10
8.1.170.0040.00418.70
8.1.160.0000.00822.16
8.1.150.0030.00519.05
8.1.140.0050.00217.75
8.1.130.0050.00319.55
8.1.120.0000.01017.71
8.1.110.0040.00417.70
8.1.100.0040.00417.80
8.1.90.0000.00717.84
8.1.80.0040.00417.81
8.1.70.0030.00317.77
8.1.60.0030.00917.89
8.1.50.0060.00317.79
8.1.40.0030.00617.86
8.1.30.0030.00517.94
8.1.20.0070.00317.96
8.1.10.0060.00317.71
8.1.00.0040.00417.65
8.0.300.0000.00818.77
8.0.290.0040.00417.41
8.0.280.0000.00718.63
8.0.270.0030.00317.43
8.0.260.0070.00017.11
8.0.250.0000.00717.20
8.0.240.0000.00717.33
8.0.230.0000.00717.23
8.0.220.0030.00317.14
8.0.210.0040.00417.21
8.0.200.0040.00417.27
8.0.190.0030.00317.34
8.0.180.0040.00417.19
8.0.170.0080.00017.30
8.0.160.0030.00517.25
8.0.150.0000.00717.27
8.0.140.0040.00417.13
8.0.130.0000.00613.61
8.0.120.0000.00817.09
8.0.110.0030.00617.25
8.0.100.0040.00417.05
8.0.90.0000.00717.18
8.0.80.0100.01017.22
8.0.70.0070.00017.25
8.0.60.0000.00717.16
8.0.50.0050.00217.12
8.0.30.0100.01017.25
8.0.20.0110.00717.63
8.0.10.0080.00017.16
8.0.00.0070.01317.00
7.4.330.0000.00515.00
7.4.320.0030.00816.70
7.4.300.0030.00316.71
7.4.290.0000.00716.66
7.4.280.0030.00616.74
7.4.270.0000.00716.74
7.4.260.0060.00316.86
7.4.250.0040.00416.82
7.4.240.0030.00316.89
7.4.230.0040.00416.91
7.4.220.0070.01016.84
7.4.210.0030.01216.95
7.4.200.0040.00416.83
7.4.190.0030.00316.76
7.4.160.0160.00016.75
7.4.150.0070.01117.40
7.4.140.0070.01017.86
7.4.130.0060.01116.84
7.4.120.0090.00816.82
7.4.110.0110.01116.82
7.4.100.0040.01516.82
7.4.90.0130.00616.55
7.4.80.0110.00719.39
7.4.70.0120.00616.90
7.4.60.0150.00816.84
7.4.50.0040.00416.85
7.4.40.0100.00717.00
7.4.30.0070.01016.75
7.4.00.0080.00414.86
7.3.330.0000.00813.45
7.3.320.0030.00313.39
7.3.310.0080.00016.51
7.3.300.0000.00716.61
7.3.290.0070.01416.62
7.3.280.0050.01416.59
7.3.270.0060.01217.40
7.3.260.0140.00716.73
7.3.250.0080.01016.61
7.3.240.0060.01216.75
7.3.230.0120.00616.81
7.3.210.0090.00816.62
7.3.200.0060.01819.39
7.3.190.0070.01016.89
7.3.180.0090.00616.99
7.3.170.0120.00416.75
7.3.160.0110.00716.89
7.3.120.0060.00915.10
7.2.330.0150.00316.86
7.2.320.0030.01917.05
7.2.310.0000.01616.78
7.2.300.0000.01617.01
7.2.290.0130.00617.11
7.1.70.0030.00617.43
7.1.60.0130.01319.70
7.1.50.0120.01217.21
7.1.00.0030.07322.48
7.0.200.0150.00914.96
7.0.140.0130.06721.95
7.0.100.0130.04020.02
7.0.90.0270.04019.89
7.0.80.0070.08719.91
7.0.70.0170.08019.96
7.0.60.0100.04320.01
7.0.50.0100.06720.38
7.0.40.0130.08719.99
7.0.30.0100.05320.05
7.0.20.0070.09320.01
7.0.10.0130.08020.12
7.0.00.0030.06720.04
5.6.280.0030.07321.03
5.6.250.0170.06320.60
5.6.240.0130.08020.77
5.6.230.0100.08720.66
5.6.220.0130.06720.63
5.6.210.0070.07720.77
5.6.200.0070.05721.05
5.6.190.0070.08321.03
5.6.180.0070.08721.06
5.6.170.0070.08321.03
5.6.160.0100.04321.12
5.6.150.0070.08321.04
5.6.140.0100.06721.01
5.6.130.0030.09021.08
5.6.120.0200.07321.05
5.6.110.0070.08020.95
5.6.100.0100.05021.17
5.6.90.0070.04721.15
5.6.80.0100.07720.34
5.6.70.0100.08020.50
5.6.60.0000.08320.33
5.6.50.0130.07720.43
5.6.40.0130.07320.40
5.6.30.0030.07720.32
5.6.20.0030.08320.44
5.6.10.0070.07320.38
5.6.00.0100.08020.35
5.5.380.0230.06320.47
5.5.370.0000.07320.38
5.5.360.0070.04320.45
5.5.350.0170.07720.46
5.5.340.0000.08720.92
5.5.330.0130.05320.87
5.5.320.0130.07020.94
5.5.310.0100.04020.87
5.5.300.0070.06020.90
5.5.290.0170.07720.77
5.5.280.0070.08320.81
5.5.270.0000.08720.82
5.5.260.0100.05020.80
5.5.250.0030.05020.70
5.5.240.0100.05020.27
5.5.230.0070.08320.31
5.5.220.0170.05720.25
5.5.210.0030.08320.18
5.5.200.0030.08020.17
5.5.190.0170.07320.14
5.5.180.0000.08320.16
5.5.160.0100.03020.14
5.5.150.0100.08020.15
5.5.140.0070.07720.19
5.5.130.0100.03020.22
5.5.120.0130.07020.17
5.5.110.0100.06720.25
5.5.100.0070.05020.17
5.5.90.0030.06020.16
5.5.80.0130.05720.14
5.5.70.0030.05720.15
5.5.60.0070.07720.06
5.5.50.0070.03320.11
5.5.40.0000.06720.06
5.5.30.0170.02719.93
5.5.20.0000.04020.09
5.5.10.0070.05319.98
5.5.00.0130.07320.05
5.4.450.0070.06719.34
5.4.440.0030.08719.29
5.4.430.0030.07319.13
5.4.420.0100.06719.43
5.4.410.0170.07319.29
5.4.400.0130.06319.06
5.4.390.0200.07018.90
5.4.380.0100.07719.06
5.4.370.0130.07319.03
5.4.360.0030.06719.13
5.4.350.0070.07018.80
5.4.340.0070.07718.95
5.4.320.0070.07319.16
5.4.310.0100.03318.90
5.4.300.0000.04719.11
5.4.290.0030.07719.14
5.4.280.0100.07719.04
5.4.270.0070.07319.12
5.4.260.0170.06318.80
5.4.250.0000.07718.97
5.4.240.0030.07719.09
5.4.230.0170.06019.05
5.4.220.0100.06318.94
5.4.210.0070.03019.07
5.4.200.0170.07019.06
5.4.190.0070.04719.01
5.4.180.0030.08319.11
5.4.170.0000.08019.10
5.4.160.0100.07319.00
5.4.150.0100.03319.07
5.4.140.0000.04016.12
5.4.130.0170.06716.41
5.4.120.0070.06316.18
5.4.110.0070.07016.36
5.4.100.0030.03316.46
5.4.90.0000.07016.30
5.4.80.0070.07016.25
5.4.70.0000.07016.35
5.4.60.0070.04016.33
5.4.50.0070.07316.46
5.4.40.0070.08016.34
5.4.30.0170.06316.15
5.4.20.0130.06316.23
5.4.10.0070.07316.40
5.4.00.0030.04015.56
5.3.290.0000.08714.62
5.3.280.0070.07714.47
5.3.270.0100.07314.57
5.3.260.0070.07314.48
5.3.250.0170.07014.44
5.3.240.0100.07014.61
5.3.230.0100.03314.45
5.3.220.0000.05314.50
5.3.210.0030.03714.57
5.3.200.0030.05014.45
5.3.190.0070.05014.57
5.3.180.0100.05714.54
5.3.170.0070.07714.43
5.3.160.0070.07714.57
5.3.150.0030.07714.57
5.3.140.0070.06314.51
5.3.130.0100.06314.54
5.3.120.0030.08314.38
5.3.110.0100.07314.40
5.3.100.0030.04713.99
5.3.90.0070.04313.96
5.3.80.0000.08313.92
5.3.70.0130.06314.00
5.3.60.0100.04014.02
5.3.50.0070.07013.82
5.3.40.0100.06713.95
5.3.30.0100.03713.79
5.3.20.0070.07013.61
5.3.10.0130.06013.63
5.3.00.0100.03013.51
5.2.170.0000.04011.40
5.2.160.0030.03711.40
5.2.150.0030.06311.40
5.2.140.0030.03311.40
5.2.130.0070.05711.40
5.2.120.0100.05711.40
5.2.110.0030.03711.40
5.2.100.0030.06311.40
5.2.90.0030.06011.40
5.2.80.0000.05011.40
5.2.70.0070.03011.40
5.2.60.0030.05711.40
5.2.50.0030.05711.40
5.2.40.0070.05711.40
5.2.30.0030.06311.40
5.2.20.0070.06311.40
5.2.10.0070.04711.40
5.2.00.0070.04311.40
5.1.60.0030.05011.40
5.1.50.0030.05311.40
5.1.40.0030.05711.40
5.1.30.0000.05311.40
5.1.20.0000.06311.40
5.1.10.0070.04311.40
5.1.00.0070.02711.40
5.0.50.0000.02711.40
5.0.40.0000.04011.40
5.0.30.0030.03711.40
5.0.20.0030.02311.40
5.0.10.0000.04311.40
5.0.00.0030.06011.40
4.4.90.0030.03011.40
4.4.80.0030.03311.40
4.4.70.0070.03011.40
4.4.60.0070.03311.40
4.4.50.0000.03311.40
4.4.40.0030.03311.40
4.4.30.0070.02311.40
4.4.20.0030.03011.40
4.4.10.0070.01011.40
4.4.00.0000.06011.40
4.3.110.0070.01311.40
4.3.100.0000.01711.40
4.3.90.0030.03011.40
4.3.80.0000.03011.40
4.3.70.0070.02711.40
4.3.60.0030.02311.40
4.3.50.0000.03711.40
4.3.40.0000.04711.40
4.3.30.0030.03011.40
4.3.20.0030.03011.40
4.3.10.0000.03311.40
4.3.00.0000.03711.40

preferences:
46.31 ms | 401 KiB | 5 Q