3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <programme channel="cnn.info" start="20131027060000" stop="20131027061500"> <title>hello CONTENT</title> <premiere/></programme> XML; $xml = simplexml_load_string($string); $start = $xml->attributes()->start; $stop = $xml->attributes()->stop; $title = $xml->title; echo "Title: " . $title . "\n"; $datetime1 = new DateTime($start); $datetime2 = new DateTime($stop); $interval = $datetime1->diff($datetime2); echo $interval->format('Time:left %m minutes');

preferences:
41.76 ms | 402 KiB | 5 Q