3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <calender> <task> <date>00/00/0000</date> <title>My Birthday</title> <description>Today is my birthday!</description> </task> <task> <date>04/08/2013</date> <title>test</title> <description>swdefswde</description> </task> <task> <date>04/02/2013</date> <title>test</title> <description>test</description> </task> <task> <date>04/01/2013</date> <title>egfwe</title> <description>wefwef</description> </task> <task> <date>04/03/2013</date> <title>ssdv</title> <description>ssdvs</description> </task> </calender> XML ); $arr=[]; foreach($xml->task as $aTask) { $arr[]=$aTask; } //print_r($arr); usort($arr,function($a,$b){ return strtotime($a->date)-strtotime($b->date); }); //print_r($arr); $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <calender> </calender> XML ); foreach($arr as $aTask) { $tTask=$xml->addChild($aTask->getName()); $tTask->addChild($aTask->date->getName(),(string)$aTask->date); $tTask->addChild($aTask->title->getName(),(string)$aTask->title); $tTask->addChild($aTask->description->getName(),(string)$aTask->description); } echo $xml->asXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0"?> <calender> <task><date>00/00/0000</date><title>My Birthday</title><description>Today is my birthday!</description></task><task><date>04/01/2013</date><title>egfwe</title><description>wefwef</description></task><task><date>04/02/2013</date><title>test</title><description>test</description></task><task><date>04/03/2013</date><title>ssdv</title><description>ssdvs</description></task><task><date>04/08/2013</date><title>test</title><description>swdefswde</description></task></calender>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.97 ms | 402 KiB | 8 Q