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') === 'Monday'; } $day = new \DateTime('2013/9/2'); var_dump(isFirstMondayayOfMonth($day)); $day = new \DateTime('2013/10/2'); 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.0.0beta10.0070.01317.00
8.0.0alpha30.0030.01716.84
8.0.0alpha20.0060.01216.87
8.0.0alpha10.0090.00417.05
7.4.80.0090.00916.87
7.4.70.0150.00616.76
7.4.60.0130.00316.85
7.4.50.0030.00316.85
7.4.40.0070.01122.77
7.4.30.0100.00616.66
7.4.00.0070.00315.02
7.3.200.0060.01219.39
7.3.190.0220.00016.39
7.3.180.0100.00616.65
7.3.170.0120.00916.67
7.3.160.0120.00416.53
7.3.120.0060.00915.17
7.2.320.0060.01016.86
7.2.310.0130.00316.59
7.2.300.0100.00716.74
7.2.290.0060.00916.67
7.2.110.0890.00314.64
7.2.100.0620.01014.45
7.2.90.0770.01014.56
7.2.80.0710.00614.55
7.2.70.0860.01015.11
7.2.60.0430.00816.04
7.2.50.1010.00014.99
7.2.40.0800.01314.82
7.2.30.0750.01115.13
7.2.20.0990.00715.07
7.2.10.0830.01315.13
7.2.00.0690.00015.05
7.1.230.0680.00613.74
7.1.220.0800.00413.60
7.1.210.1110.01313.44
7.1.200.0300.00614.78
7.1.190.0930.01013.75
7.1.180.0820.00913.58
7.1.170.0850.01714.13
7.1.160.0930.01213.81
7.1.150.0940.00713.89
7.1.140.0930.00714.06
7.1.130.1100.00313.80
7.1.120.0490.01014.11
7.1.110.0730.01014.07
7.1.100.0730.00913.80
7.1.90.0730.00713.54
7.1.80.0660.01013.66
7.1.70.0410.00715.53
7.1.60.0620.01123.57
7.1.50.0640.01233.29
7.1.40.1040.02332.05
7.1.30.0980.00031.83
7.1.20.0890.01331.91
7.1.10.0730.00714.08
7.1.00.0370.04318.09
7.0.310.0620.00613.77
7.0.300.0750.00013.67
7.0.290.0880.00313.64
7.0.280.0710.01313.37
7.0.270.0860.00313.64
7.0.260.1220.01313.59
7.0.250.0960.00313.47
7.0.240.0920.01113.63
7.0.230.0800.00613.60
7.0.220.0870.01313.78
7.0.210.0740.00313.84
7.0.200.0550.01115.22
7.0.190.0840.00613.78
7.0.180.0680.01013.77
7.0.170.0880.00713.61
7.0.160.0660.00313.43
7.0.150.0810.00313.32
7.0.140.0520.03717.93
7.0.130.0620.00313.55
7.0.120.0750.00413.63
7.0.110.0740.00913.78
7.0.100.0930.00613.80
7.0.90.0760.01013.75
7.0.80.0750.00813.60
7.0.70.0770.00613.38
7.0.60.0240.03016.70
7.0.50.0250.03715.93
7.0.40.0450.04516.91
7.0.30.0680.02516.97
7.0.20.0420.03416.91
7.0.10.0520.03317.03
7.0.00.0350.02616.98
5.6.380.0070.00713.82
5.6.370.0170.00414.23
5.6.360.0130.01014.61
5.6.350.0190.00014.31
5.6.340.0080.01214.75
5.6.330.0080.01214.36
5.6.320.0130.00914.64
5.6.310.0150.00514.36
5.6.300.0110.03417.68
5.6.290.0130.00814.34
5.6.280.0110.04017.79
5.6.270.0080.01314.64
5.6.260.0110.00414.67
5.6.250.0170.00614.60
5.6.240.0040.02014.44
5.6.230.0070.01114.63
5.6.220.0110.00814.68
5.6.210.0130.03517.46
5.6.200.0130.04216.34
5.6.190.0110.04817.47
5.6.180.1810.02117.48
5.6.170.0150.03017.38
5.6.160.0140.04617.46
5.6.150.0080.04216.27
5.6.140.0110.04416.33
5.6.130.0100.02816.28
5.6.120.0090.02417.61
5.6.110.0140.04717.61
5.6.100.0130.04417.73
5.6.90.0070.02617.69
5.6.80.0100.04317.35
5.6.70.0230.03917.32
5.6.60.0100.01314.34
5.6.50.0080.01614.33
5.6.40.0140.01014.04
5.6.30.0110.01314.33
5.6.20.0130.00814.31
5.6.10.0070.01414.09
5.6.00.0150.01014.34
5.5.380.0040.01111.52
5.5.370.0120.00411.37
5.5.360.0140.00311.12
5.5.350.0080.04415.83
5.5.340.0100.03814.66
5.5.330.0100.03015.84
5.5.320.0120.04415.67
5.5.310.0170.04915.96
5.5.300.0080.03814.69
5.5.290.0070.04414.67
5.5.280.0080.02316.11
5.5.270.0120.02316.10
5.5.260.0070.04016.05
5.5.250.0070.04615.99
5.5.240.0080.04115.80
5.5.230.0120.00010.97
5.5.220.0110.00311.33
5.5.210.0140.00011.30
5.5.200.0070.00711.25
5.5.190.0000.01511.40
5.5.180.0080.00811.08
5.5.170.0100.01414.21
5.5.160.0160.01011.41
5.5.150.0150.00010.90
5.5.140.0150.00011.09
5.5.130.0100.00311.22
5.5.120.0110.00811.08
5.5.110.0150.00210.83
5.5.100.0070.00711.51
5.5.90.0100.00211.22
5.5.80.0070.00411.30
5.5.70.0090.00411.38
5.5.60.0140.00010.84
5.5.50.0100.00510.96
5.5.40.0070.00611.41
5.5.30.0130.00311.29
5.5.20.0110.00311.36
5.5.10.0120.00211.46
5.5.00.0130.00011.07
5.4.450.0070.02315.27
5.4.440.0080.03315.31
5.4.430.0130.03315.40
5.4.420.0110.01915.05
5.4.410.0160.03815.20
5.4.400.0060.02315.08
5.4.390.0070.04015.07
5.4.380.0070.04015.21
5.4.370.0050.04315.14
5.4.360.0050.04415.09
5.4.350.0070.02415.20
5.4.340.0080.02715.05
5.4.330.0110.00510.83
5.4.320.0040.04115.12
5.4.310.0030.04315.14
5.4.300.0080.02515.12
5.4.290.0050.02515.04
5.4.280.0200.02315.05
5.4.270.0110.04014.99
5.4.260.0070.02515.14
5.4.250.0060.04215.17
5.4.240.0050.02514.90
5.4.230.0020.04314.99
5.4.220.0030.04614.92
5.4.210.0080.03615.20
5.4.200.0060.03915.14
5.4.190.0080.03314.94
5.4.180.0090.02015.08
5.4.170.0090.02014.90
5.4.160.0030.04614.97
5.4.150.0070.04715.05
5.4.140.0090.02213.84
5.4.130.0030.02313.72
5.4.120.0090.02913.87
5.4.110.0040.03713.61
5.4.100.0080.03013.89
5.4.90.0050.02513.68
5.4.80.0120.02413.76
5.4.70.0100.02313.80
5.4.60.0090.02513.78
5.4.50.0100.02113.70
5.4.40.0060.02213.73
5.4.30.0100.03713.79
5.4.20.0070.02913.89
5.4.10.0070.03213.86
5.4.00.0160.03013.54
5.3.290.0070.03512.81
5.3.280.0070.02712.69
5.3.270.0160.03112.74
5.3.260.0080.02612.79
5.3.250.0140.03112.66
5.3.240.0110.01812.74
5.3.230.0110.03712.66
5.3.220.0050.04112.68
5.3.210.0100.03912.64
5.3.200.0080.03512.46
5.3.190.0060.03412.62
5.3.180.0090.02312.55
5.3.170.0100.02012.63
5.3.160.0150.02712.64
5.3.150.0050.02512.67
5.3.140.0080.04212.59
5.3.130.0090.03012.57
5.3.120.0100.04012.60
5.3.110.0050.02312.55
5.3.100.0050.02612.37
5.3.90.0110.03712.42
5.3.80.0060.04112.27
5.3.70.0050.02612.40
5.3.60.0050.03512.39
5.3.50.0080.02512.33
5.3.40.0080.03212.39
5.3.30.0070.03812.39
5.3.20.0080.03512.17
5.3.10.0120.01612.16
5.3.00.0060.02412.02
5.2.170.0050.03310.48
5.2.160.0070.01710.42
5.2.150.0020.02710.46
5.2.140.0070.02010.49
5.2.130.0100.03310.26
5.2.120.0070.02910.28
5.2.110.0080.03310.46
5.2.100.0050.01710.25
5.2.90.0050.03510.42
5.2.80.0020.03910.31
5.2.70.0020.03110.31
5.2.60.0090.02010.34
5.2.50.0050.02210.36
5.2.40.0060.03210.35
5.2.30.0070.03010.17
5.2.20.0050.03110.24
5.2.10.0060.03410.07
5.2.00.0060.02710.00
5.1.60.0060.0169.65
5.1.50.0090.0129.62
5.1.40.0080.0139.59
5.1.30.0070.0259.82
5.1.20.0080.0139.83
5.1.10.0070.0259.63
5.1.00.0070.0269.63
5.0.50.0070.0208.89
5.0.40.0040.0118.81
5.0.30.0020.0238.76
5.0.20.0070.0208.75
5.0.10.0020.0138.72
5.0.00.0070.0228.78
4.4.90.0060.0158.45
4.4.80.0070.0148.45
4.4.70.0030.0118.45
4.4.60.0010.0248.45
4.4.50.0020.0208.45
4.4.40.0030.0358.45
4.4.30.0020.0138.45
4.4.20.0030.0088.45
4.4.10.0050.0188.45
4.4.00.0040.0138.45
4.3.110.0000.0218.45
4.3.100.0050.0078.45
4.3.90.0080.0058.45
4.3.80.0060.0128.45
4.3.70.0080.0118.45
4.3.60.0050.0128.45
4.3.50.0030.0108.45
4.3.40.0000.0188.45
4.3.30.0020.0208.45
4.3.20.0040.0138.45
4.3.10.0000.0128.45
4.3.00.0050.0158.45