3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = str_replace("/", "", '9/28/2007'); // $edrsession->scheduleDate = substr($date, 4, 4).substr($date, 0, 2).substr($date, 2, 2); echo substr($date, 4, 4).substr($date, 0, 2).substr($date, 2, 2); $test = explode('/','9/28/2007'); if(count($test[0]) < 2){ $test[0] = '0'.$test[0]; } var_dump($test[0]);
based on TvMmM
Output for 7.2.0
0079282 Warning: count(): Parameter must be an array or an object that implements Countable in /in/E1gut on line 6 string(2) "09"
Output for 4.3.0 - 7.1.10
0079282string(2) "09"