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 isFirstMondayayOfMonth(DateTime $date) { return (int)$date->format('d') <= 7 && $date->format('l') === 'Sunday'; } $day = new DateTime('2015/1/3'); var_dump(isFirstMondayayOfMonth($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.0090.00916.50
8.3.50.0150.00321.22
8.3.40.0050.01019.01
8.3.30.0040.01118.83
8.3.20.0070.00020.20
8.3.10.0060.00323.50
8.3.00.0030.00623.55
8.2.180.0090.00616.50
8.2.170.0140.00322.96
8.2.160.0170.00020.38
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0000.00819.89
8.2.110.0030.00720.81
8.2.100.0110.00017.93
8.2.90.0040.00419.34
8.2.80.0040.00417.97
8.2.70.0090.00017.75
8.2.60.0060.00317.93
8.2.50.0000.00818.09
8.2.40.0000.01020.57
8.2.30.0040.00419.57
8.2.20.0030.00617.84
8.2.10.0050.00318.24
8.2.00.0040.00418.00
8.1.280.0110.00425.92
8.1.270.0070.01022.14
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0030.00622.54
8.1.230.0120.00019.10
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.47
8.1.190.0060.00317.48
8.1.180.0080.00018.10
8.1.170.0000.00818.69
8.1.160.0000.00720.82
8.1.150.0000.00820.65
8.1.140.0040.00419.63
8.1.130.0030.00317.77
8.1.120.0040.00417.67
8.1.110.0080.00017.65
8.1.100.0040.00417.63
8.1.90.0050.00317.57
8.1.80.0070.00017.56
8.1.70.0030.00317.51
8.1.60.0050.00317.60
8.1.50.0050.00317.70
8.1.40.0060.00617.63
8.1.30.0030.00517.66
8.1.20.0040.00417.80
8.1.10.0030.00517.60
8.1.00.0070.00017.56
8.0.300.0020.00518.77
8.0.290.0060.00317.00
8.0.280.0030.00318.51
8.0.270.0030.00317.25
8.0.260.0030.00317.18
8.0.250.0040.00417.19
8.0.240.0030.00317.18
8.0.230.0050.00317.12
8.0.220.0030.00317.14
8.0.210.0030.00317.18
8.0.200.0030.00317.15
8.0.190.0070.00017.15
8.0.180.0000.00717.22
8.0.170.0000.00817.05
8.0.160.0040.00417.16
8.0.150.0040.00417.10
8.0.140.0030.00317.06
8.0.130.0050.00013.52
8.0.120.0080.00017.13
8.0.110.0070.00017.15
8.0.100.0070.00017.22
8.0.90.0000.00716.98
8.0.80.0100.00517.21
8.0.70.0000.00817.22
8.0.60.0000.00717.13
8.0.50.0030.00517.19
8.0.30.0090.01117.34
8.0.20.0140.00717.45
8.0.10.0000.00917.27
8.0.00.0110.00616.97
7.4.330.0050.00016.70
7.4.320.0030.00316.65
7.4.300.0030.00316.73
7.4.290.0000.00716.57
7.4.280.0080.00016.73
7.4.270.0050.00216.78
7.4.260.0040.00416.74
7.4.250.0000.00716.62
7.4.240.0000.00716.75
7.4.230.0070.00016.46
7.4.220.0100.01316.85
7.4.210.0040.01116.52
7.4.200.0000.00716.84
7.4.150.0180.00617.40
7.4.140.0110.00617.86
7.4.130.0100.01016.71
7.4.120.0090.01216.66
7.4.110.0140.00316.91
7.4.100.0080.00816.72
7.4.90.0080.01116.66
7.4.80.0040.01519.39
7.4.70.0060.01216.67
7.4.60.0130.00716.78
7.4.50.0040.00816.68
7.4.40.0120.00816.75
7.4.30.0100.01016.78
7.4.00.0060.00914.96
7.3.330.0030.00313.30
7.3.320.0050.00013.40
7.3.310.0030.00316.24
7.3.300.0030.00316.27
7.3.290.0090.00816.34
7.3.280.0070.00916.38
7.3.270.0060.01117.40
7.3.260.0120.00816.41
7.3.250.0020.01716.51
7.3.240.0090.00816.62
7.3.230.0030.01316.61
7.3.210.0070.01016.41
7.3.200.0070.01019.39
7.3.190.0070.01016.61
7.3.180.0130.00216.31
7.3.170.0090.00816.51
7.3.160.0060.01016.64
7.3.10.0000.01416.53
7.3.00.0030.01016.63
7.2.330.0070.01416.92
7.2.320.0040.01316.65
7.2.310.0110.00616.95
7.2.300.0030.01316.65
7.2.290.0070.01316.86
7.2.130.0130.00716.79
7.2.120.0150.00016.96
7.2.110.0040.00816.97
7.2.100.0040.01216.59
7.2.90.0100.01017.04
7.2.80.0210.00417.16
7.2.70.0110.01416.57
7.2.60.0180.00016.68
7.2.50.0080.01116.75
7.2.40.0080.00416.96
7.2.30.0060.00916.59
7.2.20.0080.00416.97
7.2.10.0090.00916.64
7.2.00.0050.00818.39
7.1.250.0030.01315.56
7.1.100.0040.00718.26
7.1.70.0090.00317.29
7.1.60.0180.00719.28
7.1.50.0170.00716.82
7.1.00.0070.07322.36
7.0.200.0040.00716.80
7.0.60.0130.07021.59
7.0.50.0100.05717.88
7.0.40.0030.06720.18
7.0.30.0130.05020.26
7.0.20.0300.08320.05
7.0.10.0030.07720.19
7.0.00.0100.07320.33
5.6.280.0030.03321.13
5.6.210.0070.06020.51
5.6.200.0070.08718.25
5.6.190.0030.05720.58
5.6.180.0170.06020.60
5.6.170.0200.04320.55
5.6.160.0130.07720.57
5.6.150.0000.04018.18
5.6.140.0070.08318.19
5.6.130.0070.06718.24
5.6.120.0100.07721.12
5.6.110.0070.06021.12
5.6.100.0170.08021.01
5.6.90.0070.04321.13
5.6.80.0030.07720.41
5.5.350.4100.04720.32
5.5.340.0000.09018.02
5.5.330.0070.05020.23
5.5.320.0630.05720.25
5.5.310.0230.04020.42
5.5.300.0030.07717.98
5.5.290.0070.07318.04
5.5.280.0030.04020.65
5.5.270.0000.04720.97
5.5.260.0100.07320.77
5.5.250.0070.07720.66
5.5.240.0070.03320.26

preferences:
46.86 ms | 401 KiB | 5 Q