3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $mes = 07; $ano = 2014; $dias = 20; $ultimo = mktime(0, 0, 0, $mes, $dias, $ano); $dia = date("j", $ultimo); $dia_semana = date("w", $ultimo); if($dia_semana == 0){ $dia--; $dia--; } if($dia_semana == 6) $dia--; $ultimo = date("d/m/Y",strtotime("$dia/$mes/$ano")); // $hoje= date("d/m/Y"); echo $hoje + "\n"; echo $ultimo;
based on cUjE9
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/EroGO on line 17 Warning: A non-numeric value encountered in /in/EroGO on line 17 3101/01/1970
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
3101/01/1970
Output for 4.3.0 - 5.0.5
3107/06/2015