3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = explode("/",$scheduleDate); for($i=0;$i<2;$i++){ if(count($date[$i]) < 2){ $date[$i] = '0'.$date[$i]; } } echo $date[2].$date[0].$date[1];
based on E1gut
Output for 7.2.0
Notice: Undefined variable: scheduleDate in /in/CRBj4 on line 2 Warning: count(): Parameter must be an array or an object that implements Countable in /in/CRBj4 on line 4 Notice: Undefined offset: 1 in /in/CRBj4 on line 4 Warning: count(): Parameter must be an array or an object that implements Countable in /in/CRBj4 on line 4 Notice: Undefined offset: 1 in /in/CRBj4 on line 5 Notice: Undefined offset: 2 in /in/CRBj4 on line 8 00
Output for 5.3.0 - 7.1.7
Notice: Undefined variable: scheduleDate in /in/CRBj4 on line 2 Notice: Undefined offset: 1 in /in/CRBj4 on line 4 Notice: Undefined offset: 1 in /in/CRBj4 on line 5 Notice: Undefined offset: 2 in /in/CRBj4 on line 8 00
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: scheduleDate in /in/CRBj4 on line 2 Notice: Undefined offset: 1 in /in/CRBj4 on line 4 Notice: Undefined offset: 1 in /in/CRBj4 on line 5 Notice: Undefined offset: 2 in /in/CRBj4 on line 8 00
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: scheduleDate in /in/CRBj4 on line 2 Notice: Undefined offset: 1 in /in/CRBj4 on line 4 Notice: Undefined offset: 1 in /in/CRBj4 on line 5 Notice: Undefined offset: 2 in /in/CRBj4 on line 8 00