3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Anagrafica { private $contactableFrom; private $contactableTo; public function getContactableFrom () { return $this->contactableFrom; } public function setContactableFrom ($cF) { $this->contactableFrom = $cF; } public function getContactableTo () { return $this->contactableTo; } public function setContactableTo ($cT) { $this->contactableTo = $cT; } } $anagrafica = new Anagrafica(); $anagrafica->setContactableFrom(\DateTime::createFromFormat('H:i:s', '07:00:00')); $anagrafica->setContactableTo(\DateTime::createFromFormat('H:i:s', '10:00:00')); $contactableFrom = ($anagrafica->getContactableFrom()) ? $anagrafica->getContactableFrom()->format('His') : '080000'; $contactableTo = ($anagrafica->getContactableTo()) ? $anagrafica->getContactableTo()->format('His') : '220000'; $currentTime = (new \DateTime())->format('His'); if ($currentTime < $contactableFrom || $currentTime > $contactableTo) { echo 'false'; } else { echo 'true'; }

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.0110.00718.76
8.3.50.0120.00622.17
8.3.40.0090.00619.04
8.3.30.0090.00618.79
8.3.20.0040.00420.34
8.3.10.0140.00720.65
8.3.00.0040.00423.53
8.2.180.0140.00316.88
8.2.170.0070.01422.96
8.2.160.0140.00022.26
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0060.00320.66
8.2.120.0040.00426.35
8.2.110.0060.00320.93
8.2.100.0090.00318.16
8.2.90.0050.00319.22
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0080.00017.93
8.2.50.0000.00818.09
8.2.40.0000.00822.12
8.2.30.0070.00019.43
8.2.20.0040.00417.88
8.2.10.0070.00018.12
8.2.00.0070.00018.12
8.1.280.0000.01525.92
8.1.270.0040.00422.27
8.1.260.0040.00428.09
8.1.250.0130.00328.09
8.1.240.0070.00323.97
8.1.230.0050.00517.89
8.1.220.0070.00017.74
8.1.210.0030.00518.77
8.1.200.0060.00317.61
8.1.190.0000.00817.60
8.1.180.0050.00318.10
8.1.170.0030.00618.84
8.1.160.0000.00820.93
8.1.150.0000.00820.80
8.1.140.0080.00019.70
8.1.130.0100.00017.82
8.1.120.0000.00717.66
8.1.110.0070.00017.57
8.1.100.0040.00417.57
8.1.90.0050.00317.63
8.1.80.0080.00017.67
8.1.70.0030.00317.70
8.1.60.0070.00017.73
8.1.50.0000.00817.61
8.1.40.0040.00417.69
8.1.30.0050.00317.67
8.1.20.0040.00417.61
8.1.10.0030.00617.69
8.1.00.0030.00817.71
8.0.300.0070.00318.77
8.0.290.0080.00016.88
8.0.280.0050.00218.43
8.0.270.0070.00017.26
8.0.260.0030.00317.39
8.0.250.0030.00317.13
8.0.240.0060.00017.16
8.0.230.0060.00317.22
8.0.220.0050.00317.13
8.0.210.0080.00017.07
8.0.200.0030.00317.18
8.0.190.0000.00817.17
8.0.180.0000.00817.13
8.0.170.0040.00417.13
8.0.160.0040.00417.04
8.0.150.0040.00417.09
8.0.140.0070.00016.98
8.0.130.0030.00313.38
8.0.120.0040.00417.10
8.0.110.0000.00817.07
8.0.100.0030.00517.11
8.0.90.0040.00416.99
8.0.80.0080.00817.13
8.0.70.0000.00816.95
8.0.60.0050.00316.99
8.0.50.0040.00417.07
8.0.30.0150.00317.32
8.0.20.0120.00817.41
8.0.10.0040.00417.09
8.0.00.0100.01116.95
7.4.330.0000.00516.70
7.4.320.0000.00716.50
7.4.300.0060.00016.54
7.4.290.0060.00316.65
7.4.280.0030.00316.63
7.4.270.0000.00716.68
7.4.260.0040.00416.66
7.4.250.0040.00416.63
7.4.240.0030.00316.75
7.4.230.0070.00016.63
7.4.220.0060.01316.60
7.4.210.0120.00516.63
7.4.200.0000.00716.84
7.4.160.0130.01016.77
7.4.150.0070.01017.40
7.4.140.0110.00617.86
7.4.130.0150.00416.70
7.4.120.0080.00916.78
7.4.110.0060.01016.98
7.4.100.0110.00716.70
7.4.90.0030.01516.61
7.4.80.0130.00619.39
7.4.70.0130.00916.88
7.4.60.0100.00716.48
7.4.50.0030.00716.48
7.4.40.0090.00916.49
7.4.30.0000.01716.42
7.4.00.0000.01515.17
7.3.330.0030.00313.38
7.3.320.0050.00213.35
7.3.310.0000.00716.48
7.3.300.0040.00416.37
7.3.290.0030.00316.31
7.3.280.0060.01216.37
7.3.270.0030.01317.40
7.3.260.0140.00316.31
7.3.250.0080.01016.59
7.3.240.0090.00916.44
7.3.230.0050.01416.53
7.3.210.0190.00316.42
7.3.200.0060.01016.59
7.3.190.0000.01616.66
7.3.180.0050.01516.51
7.3.170.0090.00616.32
7.3.160.0120.00416.32
7.2.330.0160.00316.68
7.2.320.0100.01316.81
7.2.310.0100.00616.93
7.2.300.0160.00716.74
7.2.290.0060.01017.07
7.2.60.0040.01116.91
7.2.00.0070.00319.66
7.1.200.0030.01015.92
7.1.100.0070.00718.19
7.1.70.0030.00517.34
7.1.60.0140.00719.19
7.1.50.0110.01117.09
7.1.00.0000.07322.57
7.0.200.0370.01015.11
7.0.60.0200.07721.82
7.0.50.0030.07017.97
7.0.40.0030.04720.09
7.0.30.0430.07720.14
7.0.20.0270.07020.22
7.0.10.0030.08020.23
7.0.00.0100.09320.23
5.6.280.0030.03320.91
5.6.210.0000.07320.76
5.6.200.0070.07718.18
5.6.190.0130.06720.55
5.6.180.0270.04720.77
5.6.170.0200.04720.58
5.6.160.0130.08020.71
5.6.150.0100.06318.29
5.6.140.0030.08318.24
5.6.130.0100.03718.18
5.6.120.0200.07021.16
5.6.110.0130.03720.98
5.6.100.0070.07021.00
5.6.90.0030.09320.99
5.6.80.0200.06020.34
5.5.350.4200.04320.44
5.5.340.0030.04017.97
5.5.330.0100.06720.40
5.5.320.0230.05320.27
5.5.310.0230.03720.35
5.5.300.0030.04017.96
5.5.290.0100.07317.99
5.5.280.0170.08020.79
5.5.270.0070.05320.80
5.5.260.0030.04720.96
5.5.250.0170.08020.59
5.5.240.0270.07720.27

preferences:
45.68 ms | 401 KiB | 5 Q