3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start = microtime(true); $json_1 = '[{"MobileNo":"123"},{"MobileNo":"456"}]'; $json_2 = '[{"MobileNo":"07123456701"}]'; $multiple = json_decode($json_1, true); $doc = new DOMDocument(); $doc->formatOutput = true; $root = $doc->createElement("Msg"); $doc->appendChild($root); $root->appendChild($doc->createElement("JobId", 77)); foreach ($multiple as $mobile) { $result = $doc->createElement("SubmitResult"); $result->appendChild($doc->createElement("MobileNo", $mobile["MobileNo"])); $result->appendChild($doc->createElement("StatusId", 0)); $result->appendChild($doc->createElement("StatusText", "Success: Message submitted successfully")); $root->appendChild($result); } $doc->saveXML(); $stop = microtime(true); $seconds = $stop - $start; echo "Start: " . $start . PHP_EOL; echo "Stop: " . $stop . PHP_EOL; echo "Seconds: " . $seconds . PHP_EOL; echo "Memory peak: " . memory_get_peak_usage() / 1048576 . 'MB' . PHP_EOL;
Output for 7.3.1
Start: 1547995842.6125 Stop: 1547995842.6126 Seconds: 7.0095062255859E-5 Memory peak: 0.41144561767578MB
Output for 7.3.0
Start: 1547995842.7112 Stop: 1547995842.7113 Seconds: 8.2015991210938E-5 Memory peak: 0.41144561767578MB
Output for 7.2.13
Start: 1547995842.7292 Stop: 1547995842.7293 Seconds: 8.9168548583984E-5 Memory peak: 0.40787506103516MB
Output for 7.2.12
Start: 1547995842.8355 Stop: 1547995842.8355 Seconds: 8.0108642578125E-5 Memory peak: 0.40787506103516MB
Output for 7.2.11
Start: 1547995842.9021 Stop: 1547995842.9021 Seconds: 9.7036361694336E-5 Memory peak: 0.40787506103516MB
Output for 7.2.10
Start: 1547995842.9177 Stop: 1547995842.9178 Seconds: 6.9856643676758E-5 Memory peak: 0.40787506103516MB
Output for 7.2.9
Start: 1547995842.9773 Stop: 1547995842.9774 Seconds: 8.2969665527344E-5 Memory peak: 0.40787506103516MB
Output for 7.2.8
Start: 1547995843.0612 Stop: 1547995843.0613 Seconds: 9.8943710327148E-5 Memory peak: 0.40787506103516MB
Output for 7.2.7
Start: 1547995843.0799 Stop: 1547995843.08 Seconds: 9.1075897216797E-5 Memory peak: 0.40787506103516MB
Output for 7.2.6
Start: 1547995843.131 Stop: 1547995843.1311 Seconds: 8.8930130004883E-5 Memory peak: 0.40787506103516MB
Output for 7.2.5
Start: 1547995843.2018 Stop: 1547995843.2019 Seconds: 7.319450378418E-5 Memory peak: 0.40787506103516MB
Output for 7.2.4
Start: 1547995843.2182 Stop: 1547995843.2182 Seconds: 6.6995620727539E-5 Memory peak: 0.40787506103516MB
Output for 7.2.3
Start: 1547995843.277 Stop: 1547995843.2771 Seconds: 9.2983245849609E-5 Memory peak: 0.40787506103516MB
Output for 7.2.2
Start: 1547995843.3305 Stop: 1547995843.3306 Seconds: 9.8943710327148E-5 Memory peak: 0.40787506103516MB
Output for 7.2.1
Start: 1547995843.3714 Stop: 1547995843.3715 Seconds: 8.4161758422852E-5 Memory peak: 0.40787506103516MB
Output for 7.2.0
Start: 1547995843.4355 Stop: 1547995843.4356 Seconds: 6.7949295043945E-5 Memory peak: 0.40787506103516MB
Output for 7.1.25
Start: 1547995842.7792 Stop: 1547995842.7793 Seconds: 8.2015991210938E-5 Memory peak: 0.37287139892578MB
Output for 7.1.19
Start: 1532953255.0037 Stop: 1532953255.0038 Seconds: 0.00013303756713867 Memory peak: 0.37294006347656MB
Output for 7.1.18
Start: 1532953255.004 Stop: 1532953255.0041 Seconds: 9.8943710327148E-5 Memory peak: 0.37294006347656MB
Output for 7.1.17
Start: 1532953255.005 Stop: 1532953255.0051 Seconds: 0.00014305114746094 Memory peak: 0.37294006347656MB
Output for 7.1.16
Start: 1532953255.0052 Stop: 1532953255.0054 Seconds: 0.00013399124145508 Memory peak: 0.37294006347656MB
Output for 7.1.15
Start: 1532953255.0043 Stop: 1532953255.0044 Seconds: 0.00011396408081055 Memory peak: 0.37294006347656MB
Output for 7.1.14
Start: 1532953255.0063 Stop: 1532953255.0066 Seconds: 0.00032401084899902 Memory peak: 0.37294006347656MB
Output for 7.1.13
Start: 1532953255.0042 Stop: 1532953255.0043 Seconds: 0.00015711784362793 Memory peak: 0.37294006347656MB
Output for 7.1.12
Start: 1532953255.0115 Stop: 1532953255.0116 Seconds: 0.0001528263092041 Memory peak: 0.37294006347656MB
Output for 7.1.11
Start: 1532953255.0063 Stop: 1532953255.0064 Seconds: 0.00012588500976562 Memory peak: 0.37294006347656MB
Output for 7.1.10
Start: 1532953255.0035 Stop: 1532953255.0037 Seconds: 0.00011396408081055 Memory peak: 0.37294006347656MB
Output for 7.1.9
Start: 1532953255.0048 Stop: 1532953255.005 Seconds: 0.00013613700866699 Memory peak: 0.37294006347656MB
Output for 7.1.8
Start: 1532953255.0037 Stop: 1532953255.0038 Seconds: 0.00010299682617188 Memory peak: 0.37294006347656MB
Output for 7.1.7
Start: 1532953255.0052 Stop: 1532953255.0054 Seconds: 0.00012993812561035 Memory peak: 0.37294006347656MB
Output for 7.1.6
Start: 1532953255.0273 Stop: 1532953255.0274 Seconds: 0.00013208389282227 Memory peak: 0.37352752685547MB
Output for 7.1.5
Start: 1532953255.0197 Stop: 1532953255.0198 Seconds: 0.00011706352233887 Memory peak: 0.37352752685547MB
Output for 7.1.4
Start: 1532953255.0221 Stop: 1532953255.0222 Seconds: 0.00014615058898926 Memory peak: 0.37352752685547MB
Output for 7.1.3
Start: 1532953255.0305 Stop: 1532953255.0307 Seconds: 0.00014805793762207 Memory peak: 0.37352752685547MB
Output for 7.1.2
Start: 1532953255.021 Stop: 1532953255.0212 Seconds: 0.00013589859008789 Memory peak: 0.37352752685547MB
Output for 7.1.1
Start: 1532953255.0037 Stop: 1532953255.0038 Seconds: 0.00010895729064941 Memory peak: 0.37294006347656MB
Output for 7.1.0
Start: 1532953255.0041 Stop: 1532953255.0042 Seconds: 0.00013303756713867 Memory peak: 0.37294006347656MB
Output for 7.0.31
Start: 1532953255.0047 Stop: 1532953255.0048 Seconds: 0.00014615058898926 Memory peak: 0.3729248046875MB
Output for 7.0.30
Start: 1532953255.0042 Stop: 1532953255.0043 Seconds: 0.00013995170593262 Memory peak: 0.3729248046875MB
Output for hhvm-3.22.0
Start: 1532953255.3175 Stop: 1532953255.3177 Seconds: 0.00016307830810547 Memory peak: 2MB
Output for hhvm-3.21.3
Start: 1532953255.3014 Stop: 1532953255.3028 Seconds: 0.0014503002166748 Memory peak: 2MB
Output for hhvm-3.18.5
Start: 1532953255.2699 Stop: 1532953255.2701 Seconds: 0.00018882751464844 Memory peak: 2MB
Output for 5.6.30
Start: 1532953255.0064 Stop: 1532953255.0067 Seconds: 0.00028491020202637 Memory peak: 0.22589874267578MB