3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @param int $date Unix time * @return bool */ function isActive($date) { $days = [1 => 0b1000000, 0b0100000, 0b0010000, 0b0001000, 0b0000100, 0b0000010, 0b0000001, ]; $week = 0b1001110; $day = $days[date('N', $date)]; return ($week & $day) === $day; } function test($date) { printf("%s is %s\n", date('r', $date), isActive($date) ? 'TRUE' : 'FALSE'); } test(strtotime('monday')); test(strtotime('tuesday')); test(strtotime('wednesday')); test(strtotime('thursday')); test(strtotime('friday')); test(strtotime('saturday')); test(strtotime('sunday'));

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.5.10.0120.00716.77
8.5.00.0140.00920.17
8.4.150.0010.00114.05
8.4.140.0120.01018.08
8.4.130.0130.00818.00
8.4.120.0140.00623.93
8.4.110.0110.00819.07
8.4.100.0120.00918.97
8.4.90.0120.00722.19
8.4.80.0130.00620.42
8.4.70.0110.01118.21
8.4.60.0080.01218.97
8.4.50.0080.00219.04
8.4.40.0170.00319.61
8.4.30.0150.00617.92
8.4.20.0130.00720.63
8.4.10.0090.00017.98
8.3.280.0090.01318.47
8.3.270.0130.00716.70
8.3.260.0130.00616.77
8.3.250.0140.00516.79
8.3.240.0120.00617.14
8.3.230.0110.00416.75
8.3.220.0090.00918.77
8.3.210.0050.00516.73
8.3.200.0090.01116.63
8.3.190.0120.00918.75
8.3.180.0040.00517.20
8.3.170.0100.01019.02
8.3.160.0140.00416.88
8.3.150.0060.00317.13
8.3.140.0030.00618.32
8.3.130.0060.00318.71
8.3.120.0050.00318.94
8.3.110.0060.00320.94
8.3.100.0130.00324.06
8.3.90.0060.00326.77
8.3.80.0060.00316.88
8.3.70.0120.00816.58
8.3.60.0100.01418.56
8.3.50.0090.00818.52
8.3.40.0120.00318.85
8.3.30.0110.00418.84
8.3.20.0050.00221.76
8.3.10.0050.00323.67
8.3.00.0040.00423.52
8.2.290.0100.00920.26
8.2.280.0130.00318.39
8.2.270.0090.00917.40
8.2.260.0090.00916.66
8.2.250.0130.00716.80
8.2.240.0090.00016.98
8.2.230.0130.00322.58
8.2.220.0080.00037.54
8.2.210.0040.00426.77
8.2.200.0040.00416.88
8.2.190.0090.01216.75
8.2.180.0080.00825.92
8.2.170.0060.00919.07
8.2.160.0110.00420.52
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0050.00320.64
8.2.120.0040.00426.35
8.2.110.0090.00020.52
8.2.100.0040.00817.97
8.2.90.0040.00420.67
8.2.80.0030.00620.36
8.2.70.0060.00318.05
8.2.60.0060.00318.16
8.2.50.0080.00018.10
8.2.40.0000.00819.42
8.2.30.0070.00019.41
8.2.20.0000.00818.35
8.2.10.0000.00819.33
8.2.00.0040.00418.22
8.1.330.0110.00721.97
8.1.320.0110.00318.59
8.1.310.0040.01218.00
8.1.300.0030.00616.68
8.1.290.0040.00430.84
8.1.280.0140.00725.92
8.1.270.0050.00319.08
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00023.86
8.1.230.0090.00323.83
8.1.220.0050.00317.78
8.1.210.0040.00418.85
8.1.200.0070.00317.48
8.1.190.0040.00417.25
8.1.180.0060.00318.10
8.1.170.0000.00818.76
8.1.160.0040.00419.14
8.1.150.0000.00819.05
8.1.140.0040.00419.00
8.1.130.0040.00417.59
8.1.120.0050.00217.52
8.1.110.0040.00417.69
8.1.100.0000.00817.57
8.1.90.0000.00717.68
8.1.80.0030.00617.64
8.1.70.0030.00317.59
8.1.60.0060.00617.80
8.1.50.0060.00317.64
8.1.40.0040.00417.75
8.1.30.0110.00017.84
8.1.20.0030.00717.86
8.1.10.0000.00817.76
8.1.00.0060.00317.72
8.0.300.0040.00420.04
8.0.290.0000.00717.00
8.0.280.0030.00318.47
8.0.270.0000.00817.30
8.0.260.0000.00817.00
8.0.250.0030.00517.16
8.0.240.0030.00317.16
8.0.230.0070.00017.14
8.0.220.0000.00817.04
8.0.210.0000.00717.06
8.0.200.0000.00717.07
8.0.190.0040.00417.19
8.0.180.0060.00317.14
8.0.170.0040.00417.03
8.0.160.0030.00617.13
8.0.150.0040.00416.95
8.0.140.0050.00317.04
8.0.130.0000.00613.47
8.0.120.0040.00417.09
8.0.110.0000.00717.13
8.0.100.0070.00017.00
8.0.90.0000.00817.00
8.0.80.0050.01317.09
8.0.70.0040.00417.03
8.0.60.0080.00017.10
8.0.50.0040.00416.92
8.0.30.0140.00317.30
8.0.20.0060.01217.40
8.0.10.0070.00017.24
8.0.00.0100.00716.97
7.4.330.0050.00015.55
7.4.320.0030.00316.76
7.4.300.0030.00316.74
7.4.290.0030.00316.83
7.4.280.0030.00616.71
7.4.270.0080.00016.88
7.4.260.0040.00416.86
7.4.250.0040.00416.70
7.4.240.0000.00716.86
7.4.230.0030.00316.93
7.4.220.0040.00416.71
7.4.210.0080.00816.84
7.4.200.0000.00716.48
7.4.160.0050.01016.80
7.4.140.0090.01117.86
7.4.130.0140.00516.92
7.4.120.0090.00916.77
7.4.110.0110.00617.09
7.4.100.0130.00616.85
7.4.90.0060.01216.89
7.4.80.0120.01219.39
7.4.70.0100.00616.70
7.4.60.0100.00716.64
7.4.50.0100.00316.82
7.4.40.0070.01016.88
7.4.00.0130.00315.21
7.3.330.0060.00013.38
7.3.320.0030.00313.58
7.3.310.0000.00716.58
7.3.300.0000.00716.59
7.3.290.0000.00716.45
7.3.280.0080.01116.54
7.3.260.0110.00916.65
7.3.240.0080.01216.65
7.3.230.0060.01016.61
7.3.210.0060.00916.55
7.3.200.0030.01316.73
7.3.190.0130.00916.93
7.3.180.0090.00616.47
7.3.170.0140.00716.75
7.3.160.0110.00516.64
7.3.10.0820.01015.13
7.3.00.0950.00414.76
7.2.330.0150.00916.92
7.2.320.0060.01216.74
7.2.310.0040.01216.79
7.2.300.0120.00416.63
7.2.290.0150.00616.73
7.2.130.0550.01015.09
7.2.120.0570.00715.11
7.2.110.0630.00915.12
7.2.100.0710.00315.33
7.2.90.0750.00615.14
7.2.80.0650.00714.93
7.2.70.0510.00315.15
7.2.60.0420.01115.00
7.2.50.0700.00715.22
7.2.40.0570.00015.35
7.2.30.0470.00915.10
7.2.20.0500.00715.06
7.2.10.0470.00414.90
7.2.00.0410.00915.29
7.1.250.0550.01313.88

preferences:
33.21 ms | 403 KiB | 5 Q