3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = array('2014-12-13','2014-12-14','2014-12-15','2014-12-20','2014-12-21','2014-12-22','2014-01-01','2015-02-02'); $first_day_of_week = 1; $day_of_week = date('w'); $sow_offset = ($day_of_week - $first_day_of_week + 7)%7 * 24*60*60; $week_first_day = date('Y-m-d', time()-$sow_offset); $nsow_offset = ((6 - $day_of_week + $first_day_of_week + 7)%7 +1) * 24*60*60; $next_week_first_day = date('Y-m-d', time()+$nsow_offset); echo "\ntoday: ".date("Y-m-d")." (".strtotime(date("Y-m-d")).")"; echo "\nweek_first_day: ".$week_first_day." (".strtotime($week_first_day).")"; echo "\nnext_week_first_day: ".$next_week_first_day." (".strtotime($next_week_first_day).")"; echo "\n\n"; foreach ($dates as $date) { echo "\ndate: ".$date." (".strtotime($date).")"; echo "\nThis Week? ".((strtotime($week_first_day) <= strtotime($date) && strtotime($date) < strtotime($next_week_first_day)) ? "YES" : "NO"); echo "\n\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)
7.3.10.0190.00816.36
7.3.00.0140.00616.54
7.2.130.0130.00416.89
7.2.120.0130.01217.02
7.2.110.0130.00316.96
7.2.100.0130.00716.96
7.2.90.0150.00716.79
7.2.80.0110.00817.21
7.2.70.0090.01116.90
7.2.60.0130.00917.04
7.2.50.0110.00817.02
7.2.40.0120.00917.04
7.2.30.0080.00717.13
7.2.20.0030.01216.99
7.2.10.0080.00817.07
7.2.00.0060.00817.73
7.1.250.0190.00515.79
7.1.240.0040.00415.89
7.1.230.0060.00615.86
7.1.220.0040.00715.85
7.1.210.0040.01215.51
7.1.200.0050.00715.80
7.1.190.0110.00415.94
7.1.180.0000.01515.82
7.1.170.0030.01215.88
7.1.160.0000.01315.70
7.1.150.0070.00715.80
7.1.140.0030.00616.05
7.1.130.0100.00315.79
7.1.120.0000.01516.02
7.1.110.0060.00316.03
7.1.100.0070.00317.18
7.1.90.0030.00916.00
7.1.80.0070.00715.78
7.1.70.0000.00816.74
7.1.60.0050.00717.65
7.1.50.0090.00716.28
7.1.40.0060.00615.94
7.1.30.0100.00316.09
7.1.20.0080.00315.80
7.1.10.0030.01016.09
7.1.00.0050.03919.17
7.0.330.0060.00615.67
7.0.320.0060.00315.33
7.0.310.0060.00615.72
7.0.300.0030.00915.46
7.0.290.0030.00615.63
7.0.280.0030.01315.18
7.0.270.0090.00415.30
7.0.260.0070.00715.60
7.0.250.0090.00015.43
7.0.240.0090.00015.22
7.0.230.0030.00715.77
7.0.220.0030.00715.45
7.0.210.0090.00315.43
7.0.200.0040.00416.26
7.0.190.0070.00315.66
7.0.180.0000.00815.47
7.0.170.0060.00615.77
7.0.160.0080.00415.46
7.0.150.0030.00615.52
7.0.140.0030.02218.83
7.0.130.0070.00715.75
7.0.120.0040.00415.54
7.0.110.0040.00715.34
7.0.100.0100.04017.83
7.0.90.0070.04517.77
7.0.80.0050.03017.65
7.0.70.0100.03717.74
7.0.60.0060.04317.66
7.0.50.0060.04618.08
7.0.40.0070.03416.78
7.0.30.0090.04616.85
7.0.20.0040.02716.79
7.0.10.0040.02816.80
7.0.00.0070.02316.87
5.6.380.0060.00614.63
5.6.370.0030.00614.60
5.6.360.0060.00614.47
5.6.350.0070.00314.89
5.6.340.0100.00714.71
5.6.330.0060.00614.73
5.6.320.0060.00914.82
5.6.310.0070.00714.55
5.6.300.0040.00714.34
5.6.290.0030.00814.23
5.6.280.0030.04017.74
5.6.270.0060.00614.30
5.6.260.0050.00314.36
5.6.250.0060.04417.58
5.6.240.0020.05017.46
5.6.230.0060.03017.59
5.6.220.0090.02717.61
5.6.210.0070.04217.38
5.6.200.0020.04117.81
5.6.190.0050.03317.76
5.6.180.0050.02717.92
5.6.170.0070.03717.84
5.6.160.0080.02017.74
5.6.150.0070.02817.79
5.6.140.0100.02317.61
5.6.130.0130.03117.66
5.6.120.0030.05017.64
5.6.110.0050.03917.69
5.6.100.0070.04717.65
5.6.90.0070.04517.79
5.6.80.0070.04317.32
5.6.70.0110.04017.32
5.6.60.0030.04417.35
5.6.50.0060.04217.36
5.6.40.0070.02117.38
5.6.30.0100.03017.43
5.6.20.0050.02817.50
5.6.10.0130.01917.33
5.6.00.0030.04617.49
5.5.380.0090.04015.85
5.5.370.0030.04515.86
5.5.360.0050.04215.79
5.5.350.0080.04015.72
5.5.340.0100.03315.96
5.5.330.0070.04416.10
5.5.320.0100.02216.04
5.5.310.0050.02316.07
5.5.300.0090.02516.01
5.5.290.0090.04216.05
5.5.280.0070.03516.06
5.5.270.0050.03815.99
5.5.260.0070.04615.99
5.5.250.0070.04715.87
5.5.240.0050.04215.68
5.5.230.0030.04015.71
5.5.220.0080.03015.60
5.5.210.0070.04315.72
5.5.200.0030.03015.60
5.5.190.0110.01815.62
5.5.180.0030.04015.59
5.5.170.0000.00611.08
5.5.160.0070.04015.78
5.5.150.0050.04215.72
5.5.140.0080.02715.69
5.5.130.0100.04015.83
5.5.120.0060.04315.72
5.5.110.0050.03315.62
5.5.100.0070.04715.64
5.5.90.0080.03515.56
5.5.80.0090.04015.53
5.5.70.0060.03615.53
5.5.60.0080.03115.56
5.5.50.0060.04115.58
5.5.40.0090.03715.55
5.5.30.0070.04215.55
5.5.20.0080.03315.57
5.5.10.0050.04415.57
5.5.00.0120.03215.62
5.4.450.0030.03315.25
5.4.440.0050.04215.30
5.4.430.0020.04215.30
5.4.420.0050.02615.17
5.4.410.0090.03815.21
5.4.400.0050.03515.17
5.4.390.0120.03115.07
5.4.380.0050.02915.06
5.4.370.0000.03215.03
5.4.360.0050.04115.08
5.4.350.0030.02814.89
5.4.340.0080.03815.06
5.4.330.0100.00311.23
5.4.320.0080.02815.07
5.4.310.0070.02515.02
5.4.300.0090.04014.96
5.4.290.0050.04415.15
5.4.280.0070.02315.15
5.4.270.0050.04215.05
5.4.260.0080.04015.03
5.4.250.0050.03015.17
5.4.240.0060.04315.02
5.4.230.0130.02515.07
5.4.220.0090.03714.96
5.4.210.0060.02315.08
5.4.200.0050.04115.16
5.4.190.0070.03615.18
5.4.180.0070.04015.11
5.4.170.0030.04015.00
5.4.160.0000.02915.14
5.4.150.0060.04015.01
5.4.140.0050.04013.69
5.4.130.0100.03513.74
5.4.120.0120.03513.66
5.4.110.0030.03013.76
5.4.100.0110.04013.82
5.4.90.0070.03713.74
5.4.80.0070.02113.66
5.4.70.0030.04113.63
5.4.60.0050.04113.74
5.4.50.0070.03613.70
5.4.40.0070.02813.63
5.4.30.0030.02113.70
5.4.20.0050.02613.71
5.4.10.0100.03713.68
5.4.00.0070.03313.42
5.3.290.0060.04012.81
5.3.280.0070.02812.81
5.3.270.0020.04212.73
5.3.260.0110.03012.79
5.3.250.0050.04212.72
5.3.240.0060.03212.81
5.3.230.0050.03912.73
5.3.220.0030.04212.70
5.3.210.0060.03812.73
5.3.200.0000.04012.79
5.3.190.0030.03012.72
5.3.180.0040.03912.77
5.3.170.0020.04212.79
5.3.160.0020.04212.74
5.3.150.0080.04012.74
5.3.140.0030.04412.77
5.3.130.0050.04312.79
5.3.120.0030.04512.78
5.3.110.0060.04112.76
5.3.100.0070.03712.45
5.3.90.0040.04312.49
5.3.80.0090.02412.51
5.3.70.0130.01512.52
5.3.60.0000.03512.50
5.3.50.0020.03512.36
5.3.40.0020.02812.37
5.3.30.0070.03312.42
5.3.20.0030.03812.33
5.3.10.0070.03612.21
5.3.00.0060.02812.21
5.2.170.0070.03211.87
5.2.160.0040.02311.87
5.2.150.0030.03311.87
5.2.140.0040.02611.87
5.2.130.0030.03311.87
5.2.120.0020.02211.87
5.2.110.0030.02811.87
5.2.100.0040.03411.87
5.2.90.0000.03311.87
5.2.80.0020.03311.87
5.2.70.0000.03311.87
5.2.60.0050.03511.87
5.2.50.0020.03611.87
5.2.40.0050.03111.87
5.2.30.0050.02811.87
5.2.20.0000.03311.87
5.2.10.0070.02311.87
5.2.00.0060.02611.87
5.1.60.0000.01811.87
5.1.50.0060.02511.87
5.1.40.0030.02811.87
5.1.30.0000.03011.87
5.1.20.0050.02811.87
5.1.10.0040.01511.87
5.1.00.0020.01511.87
5.0.50.0030.01811.87
5.0.40.0040.01211.87
5.0.30.0040.01311.87
5.0.20.0000.01411.87
5.0.10.0050.00911.87
5.0.00.0010.01511.87
4.4.90.0020.00811.87
4.4.80.0050.01511.87
4.4.70.0030.01711.87
4.4.60.0030.02011.87
4.4.50.0030.00611.87
4.4.40.0050.02711.87
4.4.30.0060.01311.87
4.4.20.0020.01011.87
4.4.10.0020.01211.87
4.4.00.0000.01711.87
4.3.110.0010.01011.87
4.3.100.0020.00911.87
4.3.90.0020.00911.87
4.3.80.0020.01711.87
4.3.70.0020.01011.87
4.3.60.0020.00911.87
4.3.50.0030.01111.87
4.3.40.0000.01311.87
4.3.30.0000.01811.87
4.3.20.0040.00711.87
4.3.10.0000.00911.87
4.3.00.0010.00811.87

preferences:
44.6 ms | 400 KiB | 5 Q