3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/Montevideo'); $hoy = date('d-m-Y H:i:s'); $hoystr = strtotime($hoy); $mañana = date('d-m-Y H:i:s',strtotime('+1 day', $hoystr)); /*echo $hoy; echo "\n"; echo $mañana; echo "\n";*/ $time = strtotime(date('H:i',$hoystr)); $inicio = strtotime(date('H:i','09:00:00')); $fin = strtotime(date('H:i','17:00:00')); echo "hora de ingreso: ".date('H:i',$hoystr); echo "\n"; echo "hora comienzo atencion: 09:00"; echo "\n"; $res = 'no'; $res2 = 'no'; if($time>$inicio){ $res = 'si'; } if($time<$fin){ $res = 'si'; } echo "es mayor la hora de ingreso que la de inicio atencion :".$res; echo "\n"; echo "es menor la hora de ingreso que la de fin atencion :".$res2;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /in/rc0U9:12 Stack trace: #0 /in/rc0U9(12): date('H:i', '09:00:00') #1 {main} thrown in /in/rc0U9 on line 12
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /in/rc0U9:12 Stack trace: #0 /in/rc0U9(12): date('H:i', '09:00:00') #1 {main} thrown in /in/rc0U9 on line 12
Process exited with code 255.
Output for 5.6.13 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: A non well formed numeric value encountered in /in/rc0U9 on line 12 Notice: A non well formed numeric value encountered in /in/rc0U9 on line 13 hora de ingreso: 22:47 hora comienzo atencion: 09:00 es mayor la hora de ingreso que la de inicio atencion :si es menor la hora de ingreso que la de fin atencion :no
Output for 7.3.32 - 7.3.33
hora de ingreso: 22:47 hora comienzo atencion: 09:00 es mayor la hora de ingreso que la de inicio atencion :si es menor la hora de ingreso que la de fin atencion :no
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.12
Notice: A non well formed numeric value encountered in /in/rc0U9 on line 12 Notice: A non well formed numeric value encountered in /in/rc0U9 on line 13 hora de ingreso: 23:47 hora comienzo atencion: 09:00 es mayor la hora de ingreso que la de inicio atencion :si es menor la hora de ingreso que la de fin atencion :no

preferences:
179.89 ms | 402 KiB | 266 Q