3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino){ $horaUTC = strtotime($hora); if($horaUTC >= strtotime($inicioMatutino) && $horaUTC < strtotime($finMatutino)) return "Matutino"; else if($horaUTC >= strtotime($finMatutino) && $horaUTC < strtotime($inicioVespertino) ) return "Descanso matutino"; else if($horaUTC >= strtotime($inicioVespertino) && $horaUTC < strtotime($finVespertino)) return "Vespertino"; else return "Descanso vespertino"; } function casoEspecialMatutino($hora, $finMatutino){ $previoFinMatutino = date("H:i", strtotime($hora . " -30 minutes")); echo $previoFinMatutino; } function casoEspecialVespertino($hora, $finVespertino){ } function checktime($fechaHora, $minutosTolerancia){ $fecha = date("Y-m-d", strtotime($fechaHora)); $horaMinuto = date("H:i", strtotime($fechaHora)); $noDia = date("N", strtotime($fechaHora)); $horaInicioMatutino = "09:00"; $horaFinMatutino = "15:00"; $horaInicioVespertino = "16:30"; $horaFinVespertino = "18:30"; /*echo "fecha: " . $fecha . "\nhoraMinuto: " . $horaMinuto . "\nnoDia: " . $noDia; echo tipoHorario($horaMinuto, $horaInicioMatutino, $horaInicioVespertino, $horaFinMatutino, $horaFinVespertino);*/ echo casoEspecialMatutino($horaMinuto, $horaFinMatutino); } checktime("2017-06-15 16:29:00",30); ?>

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.0150.00016.75
8.3.50.0140.00016.49
8.3.40.0130.00318.72
8.3.30.0170.00318.60
8.3.20.0040.00421.85
8.3.10.0000.00721.90
8.3.00.0050.00319.56
8.2.180.0140.00318.66
8.2.170.0080.00822.96
8.2.160.0110.00420.32
8.2.150.0100.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00020.45
8.2.120.0070.00026.35
8.2.110.0060.00319.46
8.2.100.0090.00318.16
8.2.90.0000.00818.00
8.2.80.0000.00817.97
8.2.70.0000.00918.15
8.2.60.0030.00618.34
8.2.50.0030.00618.10
8.2.40.0040.00420.55
8.2.30.0000.00719.48
8.2.20.0000.00718.21
8.2.10.0050.00518.35
8.2.00.0040.00418.18
8.1.280.0090.00925.92
8.1.270.0080.00020.78
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00322.18
8.1.230.0030.00719.04
8.1.220.0080.00017.77
8.1.210.0060.00318.77
8.1.200.0060.00317.48
8.1.190.0070.00317.48
8.1.180.0000.00818.10
8.1.170.0030.00722.09
8.1.160.0070.00018.90
8.1.150.0040.00420.24
8.1.140.0000.00719.70
8.1.130.0040.00419.00
8.1.120.0030.00617.59
8.1.110.0040.00417.71
8.1.100.0000.00717.60
8.1.90.0040.00417.68
8.1.80.0030.00417.67
8.1.70.0000.00717.68
8.1.60.0030.00517.83
8.1.50.0030.00517.71
8.1.40.0060.00317.73
8.1.30.0060.00317.77
8.1.20.0000.00817.92
8.1.10.0000.00817.68
8.1.00.0090.00317.62
8.0.300.0020.00518.77
8.0.290.0040.00417.13
8.0.280.0080.00018.61
8.0.270.0050.00217.43
8.0.260.0070.00019.03
8.0.250.0000.00717.25
8.0.240.0050.00517.15
8.0.230.0070.00017.13
8.0.220.0030.00317.14
8.0.210.0000.00817.14
8.0.200.0110.00017.16
8.0.190.0060.00317.21
8.0.180.0000.00917.21
8.0.170.0070.00017.20
8.0.160.0040.00417.16
8.0.150.0040.00417.23
8.0.140.0030.00517.16
8.0.130.0000.00613.59
8.0.120.0040.00417.11
8.0.110.0040.00417.13
8.0.100.0070.00017.07
8.0.90.0050.00317.21
8.0.80.0140.00717.23
8.0.70.0050.00217.25
8.0.60.0040.00416.96
8.0.50.0030.00417.02
8.0.30.0080.01017.25
8.0.20.0120.00817.50
8.0.10.0040.00417.28
8.0.00.0060.01317.20
7.4.330.0050.00015.55
7.4.320.0000.00616.74
7.4.300.0030.00316.62
7.4.290.0040.00416.87
7.4.280.0080.00016.73
7.4.270.0030.00316.72
7.4.260.0070.00016.69
7.4.250.0040.00416.64
7.4.240.0000.00716.72
7.4.230.0000.00716.90
7.4.220.0110.00716.92
7.4.210.0060.01316.89
7.4.200.0030.00316.66
7.4.160.0060.01016.84
7.4.150.0070.01117.40
7.4.140.0090.00917.86
7.4.130.0090.01016.64
7.4.120.0080.01116.75
7.4.110.0060.01216.88
7.4.100.0120.00616.71
7.4.90.0120.00416.82
7.4.80.0120.00319.39
7.4.70.0090.00916.71
7.4.60.0060.00916.92
7.4.50.0030.00816.63
7.4.40.0160.00616.88
7.4.30.0130.01016.71
7.4.10.0070.01116.80
7.4.00.0070.01015.66
7.3.330.0030.00313.48
7.3.320.0030.00313.49
7.3.310.0030.00316.51
7.3.300.0040.00416.43
7.3.290.0130.00516.52
7.3.280.0080.00816.52
7.3.270.0090.00917.40
7.3.260.0110.01016.80
7.3.250.0070.01116.77
7.3.240.0100.00716.63
7.3.230.0190.01016.68
7.3.210.0080.00816.77
7.3.200.0100.01016.92
7.3.190.0030.01316.83
7.3.180.0130.00316.74
7.3.170.0000.01616.86
7.3.160.0040.01216.72
7.3.130.0070.01316.54
7.3.120.0060.01315.97
7.3.110.0070.00915.90
7.3.100.0110.00415.91
7.3.90.0090.00515.65
7.3.80.0050.01116.04
7.3.70.0090.00915.89
7.3.60.0080.00215.92
7.3.50.0070.00915.93
7.3.40.0040.01315.78
7.3.30.0060.00815.90
7.3.20.0060.00917.64
7.3.10.0080.00817.50
7.3.00.0100.00717.65
7.2.330.0100.00716.97
7.2.320.0120.00616.98
7.2.310.0100.01016.59
7.2.300.0060.01116.68
7.2.290.0090.00917.07
7.2.260.0140.00716.83
7.2.250.0070.01216.26
7.2.240.0050.01115.81
7.2.230.0090.00316.19
7.2.220.0080.00915.97
7.2.210.0050.00616.03
7.2.200.0110.00816.04
7.2.190.0090.00816.08
7.2.180.0090.00916.08
7.2.170.0040.01115.99
7.2.160.0030.01216.84
7.2.150.0060.00918.63
7.2.140.0060.01218.54
7.2.130.0080.01118.67
7.2.120.0130.00918.74
7.2.110.0140.00918.63
7.2.100.0110.01418.78
7.2.90.0040.01318.59
7.2.80.0070.01018.69
7.2.70.0100.00718.67
7.2.60.0050.01017.87
7.2.50.0070.00517.97
7.2.40.0110.00418.80
7.2.30.0110.00818.64
7.2.20.0030.01318.66
7.2.10.0070.00718.57
7.2.00.0030.00718.60
7.1.330.0030.00916.69
7.1.320.0030.00816.84
7.1.310.0040.01316.91
7.1.300.0100.00416.92
7.1.290.0090.00616.89
7.1.280.0060.00516.74
7.1.270.0080.00616.74
7.1.260.0070.01016.76
7.1.250.0090.01317.54
7.1.240.0090.01317.48
7.1.230.0100.00717.69
7.1.220.0040.00917.56
7.1.210.0040.01217.55
7.1.200.0040.00916.89
7.1.190.0040.01117.58
7.1.180.0000.00917.50
7.1.170.0000.01517.37
7.1.160.0090.00617.41
7.1.150.0060.00917.65
7.1.140.0130.00317.68
7.1.130.0070.01017.43
7.1.120.0070.01017.56
7.1.110.0100.00717.71
7.1.100.0090.00617.70
7.1.90.0070.00717.52
7.1.80.0090.00917.60
7.1.70.0030.01017.46
7.1.60.0430.01225.55
7.1.50.0450.01025.45
7.1.40.0350.01025.04
7.1.30.0380.00825.18
7.1.20.0370.00825.24
7.1.10.0260.00516.18
7.1.00.0410.00616.25
7.0.330.0080.00817.21
7.0.320.0070.01017.13
7.0.310.0060.00317.34
7.0.300.0030.01017.16
7.0.290.0060.01017.19
7.0.280.0040.00417.07
7.0.270.0060.00617.21
7.0.260.0060.00917.20
7.0.250.0120.00317.04
7.0.240.0070.00717.23
7.0.230.0140.00017.04
7.0.220.0060.00617.30
7.0.210.0000.01617.23
7.0.200.0460.00516.35
7.0.190.0280.00816.06
7.0.180.0250.00515.91
7.0.170.0350.00815.94
7.0.160.0350.00515.98
7.0.150.0280.00815.82
7.0.140.0300.00815.95
7.0.130.0330.00716.05
7.0.120.0390.00616.01
7.0.110.0300.00716.05
7.0.100.0350.01115.87
7.0.90.0300.00415.90
7.0.80.0310.01016.03
7.0.70.0300.00916.02
7.0.60.0350.01415.89
7.0.50.0270.01015.93
7.0.40.0300.01114.94
7.0.30.0670.00714.99
7.0.20.0310.01114.90
7.0.10.0320.00814.92
7.0.00.0450.01014.89
5.6.400.0060.01015.92
5.6.390.0100.00716.29
5.6.380.0070.01016.09
5.6.370.0050.00515.91
5.6.360.0040.01116.30
5.6.350.0060.00916.00
5.6.340.0000.01416.15
5.6.330.0070.00716.00
5.6.320.0120.00316.16
5.6.310.0040.01216.13
5.6.300.0070.00715.98
5.6.290.0060.00315.84
5.6.280.0070.00715.93
5.6.270.0030.01316.21
5.6.260.0040.00815.90
5.6.250.0100.00615.95
5.6.240.0060.00315.89
5.6.230.0030.01016.18
5.6.220.0000.01316.29
5.6.210.0030.01015.92
5.6.200.0060.00316.00
5.6.190.0070.00715.83
5.6.180.0040.00815.88
5.6.170.0060.00316.26
5.6.160.0030.01015.76
5.6.150.0030.00615.91
5.6.140.0030.00916.00
5.6.130.0080.00315.92
5.6.120.0100.00016.11
5.6.110.0040.00715.90
5.6.100.0070.01116.30
5.6.90.0030.01015.98
5.6.80.0060.00315.79
5.6.70.0000.01215.77
5.6.60.0120.00015.81
5.6.50.0030.01015.72
5.6.40.0060.00616.19
5.6.30.0000.01015.96
5.6.20.0080.00815.89
5.6.10.0070.00715.91
5.6.00.0000.01515.77

preferences:
74.69 ms | 401 KiB | 5 Q