3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Check if a given date is the first Monday of the month * * @param \DateTime $date * @return bool */ function isFirstSundayOfMonth(DateTime $date) { return (int)$date->format('d') <= 7 && $date->format('l') === 'Sunday'; } $day = new DateTime(); var_dump($day); var_dump(isFirstSundayOfMonth($day));

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.0100.00716.63
8.3.50.0090.00921.17
8.3.40.0040.01118.75
8.3.30.0070.01018.87
8.3.20.0050.00320.25
8.3.10.0090.00023.67
8.3.00.0040.00423.65
8.2.180.0120.00316.63
8.2.170.0080.00622.96
8.2.160.0030.01319.45
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00421.11
8.2.120.0070.00026.35
8.2.110.0070.00320.58
8.2.100.0060.00618.03
8.2.90.0060.00319.16
8.2.80.0000.00917.97
8.2.70.0030.00617.88
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0000.00819.95
8.2.30.0030.00518.18
8.2.20.0030.00617.83
8.2.10.0000.00718.21
8.2.00.0000.00718.19
8.1.280.0060.01525.92
8.1.270.0030.01422.24
8.1.260.0030.00528.09
8.1.250.0000.00728.09
8.1.240.0000.00923.83
8.1.230.0080.00417.95
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0080.00017.48
8.1.180.0050.00318.10
8.1.170.0060.00318.84
8.1.160.0040.00418.96
8.1.150.0030.00620.74
8.1.140.0000.00819.56
8.1.130.0030.00517.82
8.1.120.0040.00417.67
8.1.110.0080.00017.65
8.1.100.0030.00517.58
8.1.90.0040.00417.65
8.1.80.0040.00417.69
8.1.70.0050.00217.75
8.1.60.0040.00417.71
8.1.50.0000.00817.70
8.1.40.0000.00917.67
8.1.30.0050.00317.72
8.1.20.0040.00417.64
8.1.10.0030.00517.63
8.1.00.0040.00417.57
8.0.300.0060.00318.77
8.0.290.0000.00816.88
8.0.280.0050.00318.45
8.0.270.0000.00717.32
8.0.260.0000.00717.33
8.0.250.0030.00317.27
8.0.240.0030.00317.23
8.0.230.0000.00717.24
8.0.220.0000.00817.10
8.0.210.0030.00317.15
8.0.200.0060.00017.19
8.0.190.0060.00317.23
8.0.180.0040.00417.25
8.0.170.0000.00717.11
8.0.160.0000.00817.19
8.0.150.0000.00717.05
8.0.140.0000.00717.01
8.0.130.0030.00313.50
8.0.120.0000.00816.96
8.0.110.0070.00017.18
8.0.100.0040.00417.05
8.0.90.0020.00517.16
8.0.80.0060.00917.12
8.0.70.0040.00417.05
8.0.60.0000.00817.04
8.0.50.0080.00017.11
8.0.30.0090.00917.39
8.0.20.0090.01217.47
8.0.10.0050.00317.23
8.0.00.0130.00716.87
7.4.330.0030.00316.89
7.4.320.0000.00616.64
7.4.300.0000.00816.73
7.4.290.0000.00716.61
7.4.280.0040.00416.73
7.4.270.0040.00416.75
7.4.260.0040.00416.63
7.4.250.0000.00816.75
7.4.240.0040.00416.77
7.4.230.0030.00316.55
7.4.220.0070.01116.68
7.4.210.0070.00716.82
7.4.200.0040.00416.77
7.4.160.0050.01116.75
7.4.150.0090.01317.40
7.4.140.0130.01217.86
7.4.130.0150.00416.77
7.4.120.0190.00316.57
7.4.110.0210.00016.67
7.4.100.0140.00316.62
7.4.90.0030.01516.70
7.4.80.0050.01119.39
7.4.70.0160.00516.77
7.4.60.0140.00316.68
7.4.50.0060.00616.81
7.4.40.0170.00316.54
7.4.30.0060.01216.43
7.4.00.0030.01015.18
7.3.330.0050.00013.16
7.3.320.0000.00513.39
7.3.310.0000.00716.32
7.3.300.0070.00016.24
7.3.290.0090.01016.34
7.3.280.0060.01016.33
7.3.270.0090.00917.40
7.3.260.0170.00316.32
7.3.250.0080.00916.54
7.3.240.0090.01116.67
7.3.230.0160.00616.39
7.3.210.0070.01016.60
7.3.200.0060.00919.39
7.3.190.0080.00816.59
7.3.180.0030.01416.47
7.3.170.0090.00916.74
7.3.160.0090.01316.41
7.3.120.0080.00815.07
7.3.110.0060.01214.89
7.3.100.0140.00414.70
7.3.90.0090.00615.05
7.3.80.0070.00315.13
7.3.70.0040.01114.95
7.3.60.0060.00614.81
7.3.50.0120.00015.08
7.3.40.0100.00714.84
7.3.30.0000.01514.75
7.3.20.0040.01116.65
7.3.10.0000.01616.69
7.3.00.0130.00016.66
7.2.330.0100.01416.57
7.2.320.0100.00716.86
7.2.310.0040.01216.85
7.2.300.0070.01016.72
7.2.290.0030.01316.71
7.2.240.0110.00715.10
7.2.230.0100.00315.34
7.2.220.0090.00015.11
7.2.210.0040.00715.09
7.2.200.0060.00315.07
7.2.190.0030.01015.20
7.2.180.0100.00615.02
7.2.170.0070.01015.18
7.2.160.0070.00715.28
7.2.150.0060.00917.08
7.2.140.0070.00817.11
7.2.130.0090.00617.12
7.2.120.0060.01016.89
7.2.110.0060.00916.93
7.2.100.0070.00717.02
7.2.90.0110.00716.89
7.2.80.0050.00716.74
7.2.70.0100.00617.00
7.2.60.0050.01116.99
7.2.50.0030.01416.98
7.2.40.0070.01016.88
7.2.30.0120.00617.21
7.2.20.0090.00616.82
7.2.10.0060.00616.79
7.2.00.0020.01418.09
7.1.330.0030.01316.05
7.1.320.0090.00416.01
7.1.310.0130.00315.95
7.1.300.0040.00816.00
7.1.290.0060.00615.95
7.1.280.0030.01316.05
7.1.270.0040.01215.65
7.1.260.0000.01716.02
7.1.250.0070.00715.82
7.1.200.0090.00615.88
7.1.100.0080.00318.09
7.1.70.0030.00717.45
7.1.60.0090.01619.28
7.1.50.0030.01616.82
7.1.00.0030.07322.52
7.0.200.0000.01117.02
7.0.60.0030.05321.74
7.0.50.0070.07717.87
7.0.40.0100.07720.27
7.0.30.0330.05720.20
7.0.20.0400.04320.23
7.0.10.0100.06020.20
7.0.00.0030.07320.23
5.6.280.0000.06720.99
5.6.210.0170.07320.47
5.6.200.0130.07718.29
5.6.190.0070.07020.42
5.6.180.0300.07320.60
5.6.170.0270.07020.47
5.6.160.0070.08020.48
5.6.150.0000.04318.21
5.6.140.0000.05318.16
5.6.130.0070.06718.14
5.6.120.0100.07321.00
5.6.110.0070.04020.98
5.6.100.0100.08020.96
5.6.90.0200.06021.00
5.6.80.0030.07720.51
5.5.350.4370.03720.41
5.5.340.0170.07017.98
5.5.330.0030.08320.45
5.5.320.0370.05720.25
5.5.310.0270.07020.31
5.5.300.0130.05717.97
5.5.290.0000.09018.08
5.5.280.0030.04720.95
5.5.270.0030.04720.86
5.5.260.0130.07020.65
5.5.250.0030.05720.61
5.5.240.0100.03020.23

preferences:
46.42 ms | 401 KiB | 5 Q