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)); echo $weeks; 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.0070.01018.56
8.3.50.0150.00522.11
8.3.40.0080.00818.96
8.3.30.0060.00919.21
8.3.20.0040.00420.21
8.3.10.0000.00823.53
8.3.00.0030.00520.89
8.2.180.0120.00316.86
8.2.170.0100.01322.96
8.2.160.0070.00720.45
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0050.00226.16
8.2.120.0060.00320.85
8.2.110.0040.00422.18
8.2.100.0070.00420.57
8.2.90.0030.00719.32
8.2.80.0060.00317.97
8.2.70.0090.00417.75
8.2.60.0070.00318.05
8.2.50.0090.00018.07
8.2.40.0000.01218.34
8.2.30.0040.00418.47
8.2.20.0000.00917.94
8.2.10.0090.00018.37
8.2.00.0000.00918.16
8.1.280.0040.01225.92
8.1.270.0060.01324.00
8.1.260.0050.00326.35
8.1.250.0030.00628.09
8.1.240.0090.00022.24
8.1.230.0070.00419.27
8.1.220.0060.00317.77
8.1.210.0030.00518.77
8.1.200.0030.00617.63
8.1.190.0060.00317.61
8.1.180.0030.00618.10
8.1.170.0000.00918.75
8.1.160.0000.00822.08
8.1.150.0050.00318.97
8.1.140.0050.00317.75
8.1.130.0000.00717.93
8.1.120.0030.00617.71
8.1.110.0000.00817.80
8.1.100.0050.00317.71
8.1.90.0030.00617.84
8.1.80.0030.00517.70
8.1.70.0070.00017.79
8.1.60.0060.00617.74
8.1.50.0060.00317.83
8.1.40.0040.00417.71
8.1.30.0000.00817.98
8.1.20.0000.00917.93
8.1.10.0000.00817.79
8.1.00.0040.00417.75
8.0.300.0000.00918.77
8.0.290.0000.00817.00
8.0.280.0050.00218.72
8.0.270.0050.00317.46
8.0.260.0030.00317.35
8.0.250.0050.00217.31
8.0.240.0070.00017.29
8.0.230.0050.00217.21
8.0.220.0040.00417.14
8.0.210.0040.00417.13
8.0.200.0080.00017.24
8.0.190.0000.01017.34
8.0.180.0030.00717.32
8.0.170.0030.00617.16
8.0.160.0040.00417.24
8.0.150.0000.00817.09
8.0.140.0040.00417.20
8.0.130.0000.00613.53
8.0.120.0000.00817.25
8.0.110.0050.00317.14
8.0.100.0000.00817.24
8.0.90.0050.00317.12
8.0.80.0030.01417.20
8.0.70.0080.00017.15
8.0.60.0040.00417.22
8.0.50.0080.00017.22
8.0.30.0120.01317.26
8.0.20.0100.01317.40
8.0.10.0000.00817.23
8.0.00.0050.01417.13
7.4.330.0000.00615.00
7.4.320.0060.00316.89
7.4.300.0000.00716.87
7.4.290.0050.00216.89
7.4.280.0030.00616.79
7.4.270.0030.00616.87
7.4.260.0030.00616.90
7.4.250.0000.00916.71
7.4.240.0040.00416.84
7.4.230.0040.00416.54
7.4.220.0060.01316.87
7.4.210.0070.01016.68
7.4.200.0070.00016.89
7.4.190.0040.00417.04
7.4.160.0120.00616.90
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0140.00816.82
7.4.120.0070.01116.84
7.4.110.0100.01416.80
7.4.100.0100.01116.84
7.4.90.0100.00816.90
7.4.80.0100.01019.39
7.4.70.0200.00016.96
7.4.60.0060.01216.78
7.4.50.0040.00416.64
7.4.40.0030.01416.77
7.4.30.0050.01316.67
7.4.00.0050.00915.38
7.3.330.0000.00813.38
7.3.320.0050.00013.48
7.3.310.0000.00816.70
7.3.300.0040.00416.55
7.3.290.0070.00816.68
7.3.280.0120.00816.64
7.3.270.0060.01217.40
7.3.260.0090.01316.89
7.3.250.0070.01216.83
7.3.240.0090.00916.78
7.3.230.0030.01616.78
7.3.210.0120.01216.66
7.3.200.0140.00919.39
7.3.190.0090.00916.66
7.3.180.0060.01516.71
7.3.170.0090.01416.78
7.3.160.0120.00616.70
7.3.120.0030.01515.21
7.3.110.0060.01015.22
7.3.100.0000.01615.18
7.3.90.0070.00315.23
7.3.80.0120.00415.39
7.3.70.0030.01014.93
7.3.60.0060.00614.84
7.3.50.0040.01114.92
7.3.40.0000.01414.85
7.3.30.0060.00615.15
7.3.20.0120.00616.87
7.3.10.0050.00916.81
7.3.00.0050.00716.87
7.2.330.0030.01616.98
7.2.320.0150.01217.11
7.2.310.0050.01216.84
7.2.300.0060.01216.95
7.2.290.0140.01316.79
7.2.250.0110.01115.26
7.2.240.0090.01215.16
7.2.230.0000.01915.55
7.2.220.0140.00015.45
7.2.210.0110.00715.19
7.2.200.0110.00415.18
7.2.190.0110.00315.33
7.2.180.0070.00715.17
7.2.170.0070.01015.35
7.2.130.0000.01317.21
7.2.120.0080.00417.18
7.2.110.0050.00517.21
7.2.100.0030.00917.19
7.2.90.0040.01117.24
7.2.80.0000.01017.21
7.2.70.0060.01016.91
7.2.60.0110.00617.18
7.2.50.0080.00417.25
7.2.40.0000.01517.26
7.2.30.0030.01017.29
7.2.20.0100.00716.99
7.2.10.0000.01017.23
7.2.00.0070.01017.16
7.1.330.0070.00715.82
7.1.320.0060.00616.14
7.1.310.0070.00716.09
7.1.300.0060.00316.15
7.1.290.0060.00916.22
7.1.280.0060.00615.99
7.1.270.0070.00715.84
7.1.260.0070.00716.09
7.1.250.0090.00915.79
7.1.70.0170.00017.50
7.1.60.0070.01819.70
7.1.50.0100.01317.21
7.1.00.0030.08022.44
7.0.200.0250.00416.87
7.0.140.0030.07721.99
7.0.80.0200.07019.89
7.0.70.0130.05719.93
7.0.60.0730.05719.81
7.0.50.0200.07320.33
7.0.40.0030.04720.17
7.0.30.0030.04020.10
7.0.20.0030.07720.10
7.0.10.0030.04020.07
7.0.00.0070.04020.03
5.6.280.0100.06320.83
5.6.230.0100.07720.58
5.6.220.0100.08020.62
5.6.210.0100.06320.63
5.6.200.0000.08320.96
5.6.190.0100.06020.96
5.6.180.0070.04020.96
5.6.170.0100.06721.18
5.6.160.0030.04320.95
5.6.150.0030.04320.95
5.6.140.0000.04321.02
5.6.130.0030.04320.96
5.6.120.0030.04021.05
5.6.110.0000.04721.10
5.6.100.0100.04320.96
5.6.90.0100.03321.06
5.6.80.0000.04320.48
5.6.70.0030.04320.46
5.6.60.0030.03720.41
5.6.50.0030.04020.40
5.6.40.0000.04020.46
5.6.30.0100.05320.53
5.6.20.0030.07720.30
5.6.10.0030.04320.31
5.6.00.0070.07320.45
5.5.370.0170.06720.38
5.5.360.0070.08320.48
5.5.350.0070.08720.49
5.5.340.0100.04720.88
5.5.330.0100.03720.93
5.5.320.0030.04320.93
5.5.310.0100.03720.77
5.5.300.0070.04020.74
5.5.290.0030.04020.81
5.5.280.0100.03720.91
5.5.270.0000.04720.83
5.5.260.0030.04720.88
5.5.250.0000.04720.74
5.5.240.0030.04020.31
5.5.230.0070.04320.16
5.5.220.0070.03720.01
5.5.210.0030.04020.12
5.5.200.0070.03720.01
5.5.190.0100.05020.27
5.5.180.0070.06720.28
5.5.160.0000.04320.28
5.5.150.0100.03320.18
5.5.140.0070.04320.09
5.5.130.0070.03720.28
5.5.120.0030.04020.13
5.5.110.0070.04020.13
5.5.100.0030.04320.11
5.5.90.0070.03720.08
5.5.80.0030.03320.11
5.5.70.0070.03319.95
5.5.60.0170.08319.97
5.5.50.0130.04320.07
5.5.40.0030.04319.96
5.5.30.0170.07020.00
5.5.20.0130.05020.14
5.5.10.0030.09319.93
5.5.00.0070.08719.98
5.4.450.0100.04019.55
5.4.440.0100.07319.38
5.4.430.0000.05019.44
5.4.420.0070.06319.13
5.4.410.0070.03719.24
5.4.400.0070.04019.03
5.4.390.0030.04018.78
5.4.380.0030.04319.05
5.4.370.0070.04019.03
5.4.360.0030.03719.23
5.4.350.0030.03319.13
5.4.340.0030.04019.06
5.4.320.0030.04018.81
5.4.310.0070.05019.12
5.4.300.0070.04019.23
5.4.290.0030.04019.07
5.4.280.0130.03019.11
5.4.270.0070.03718.91
5.4.260.0030.03718.93
5.4.250.0030.04019.05
5.4.240.0070.03719.13
5.4.230.0130.06318.77
5.4.220.0070.08018.94
5.4.210.0070.08319.04
5.4.200.0170.07319.14
5.4.190.0030.09018.77
5.4.180.0100.04719.06
5.4.170.0200.07319.09
5.4.160.0100.07019.02
5.4.150.0100.06718.92
5.4.140.0030.08016.34
5.4.130.0130.05316.31
5.4.120.0070.06016.38
5.4.110.0200.04316.45
5.4.100.0070.04316.41
5.4.90.0070.05316.36
5.4.80.0070.04316.45
5.4.70.0070.04016.20
5.4.60.0070.03716.28
5.4.50.0130.07016.21
5.4.40.0100.07016.26
5.4.30.0030.04716.42
5.4.20.0170.06316.39
5.4.10.0070.04316.31
5.4.00.0070.08315.72
5.3.290.0030.04014.54
5.3.280.0100.04314.62
5.3.270.0100.07714.62
5.3.260.0070.08014.53
5.3.250.0070.07714.46
5.3.240.0130.07014.53
5.3.230.0370.05014.62
5.3.220.0130.07014.55
5.3.210.0070.07014.58
5.3.200.0000.08014.44
5.3.190.0130.04314.54
5.3.180.0100.07314.57
5.3.170.0100.07714.40
5.3.160.0170.07014.44
5.3.150.0030.05014.44
5.3.140.0030.07314.58
5.3.130.0070.05714.39
5.3.120.0030.05314.39
5.3.110.0100.04014.40
5.3.100.0100.04014.02
5.3.90.0100.04314.02
5.3.80.0100.04314.02
5.3.70.0000.05013.99
5.3.60.0030.04713.88
5.3.50.0100.07013.95
5.3.40.0130.06313.83
5.3.30.0070.04313.91
5.3.20.0070.05713.69
5.3.10.0000.07713.66
5.3.00.0000.06013.51
5.2.170.0030.03711.14
5.2.160.0070.04011.12
5.2.150.0030.04711.02
5.2.140.0130.02311.12
5.2.130.0000.07011.11
5.2.120.0070.04310.96
5.2.110.0000.05011.06
5.2.100.0030.04311.15
5.2.90.0030.06311.11
5.2.80.0000.03310.94
5.2.70.0070.02710.98
5.2.60.0070.05311.16
5.2.50.0170.05011.00
5.2.40.0000.06711.00
5.2.30.0070.06011.05
5.2.20.0070.04711.02
5.2.10.0030.05010.99
5.2.00.0000.04710.81
5.1.60.0100.05010.00
5.1.50.0030.04010.10
5.1.40.0030.04010.05
5.1.30.0030.03310.47
5.1.20.0070.03010.47
5.1.10.0000.03310.17
5.1.00.0000.03010.18
5.0.50.0100.0438.60
5.0.40.0070.0278.53
5.0.30.0030.0538.32
5.0.20.0070.0378.10
5.0.10.0000.0408.26
5.0.00.0000.0638.30
4.4.90.0030.0207.20
4.4.80.0000.0377.20
4.4.70.0100.0307.20
4.4.60.0030.0237.20
4.4.50.0030.0337.20
4.4.40.0030.0537.20
4.4.30.0070.0277.20
4.4.20.0030.0377.20
4.4.10.0000.0307.20
4.4.00.0030.0437.20
4.3.110.0030.0337.20
4.3.100.0030.0237.20
4.3.90.0000.0277.20
4.3.80.0000.0507.20
4.3.70.0030.0137.20
4.3.60.0070.0277.20
4.3.50.0070.0237.20
4.3.40.0070.0207.20
4.3.30.0030.0277.20
4.3.20.0000.0237.20
4.3.10.0030.0277.20
4.3.00.0000.0377.20

preferences:
40.88 ms | 401 KiB | 5 Q