3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo getDateAndTime(simplexml_load_string(' <x> <date year="2013" month="12" date="29" day="7"/> <time hour="19" minute="07" second="05" timezone="Eastern" utc-hour="-5" utc-minute="00"/> </x> ')); function getDateAndTime($s) { xmlToDate ( $s->date ) . " " . xmlToTime ( $s->time ); } function xmlToDate($xml) { return $xml ['year'] . "-" . str_pad ( $xml ['month'], 2, '0', STR_PAD_LEFT ) . "-" . str_pad ( $xml ['date'], 2, '0', STR_PAD_LEFT ); } function xmlToTime($xml) { return str_pad ( ($xml ['hour'] - 8 - $xml ['utc-hour']), 2, '0', STR_PAD_LEFT ) . ":" . str_pad ( $xml ['minute'], 2, '0', STR_PAD_LEFT ) . ":00"; }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/DfjLA on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/DfjLA on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/DfjLA on line 3