3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Does NOT work as expected. $sxml = simplexml_load_string('<test><num>20.5</num><den>1</den></test>'); $ans = $sxml->num / $sxml->den; echo "XML Test:\n"; echo "{$sxml->num} / {$sxml->den} = {$ans}\n"; // Output: 20.5 / 1 = 20 $ans = (string)$sxml->num / (string)$sxml->den; echo "{$sxml->num} / {$sxml->den} = {$ans}\n"; // Works as expected. $num = "20.5"; $den = "1"; $ans = $num / $den; echo "String Test:\n"; echo "{$num} / {$den} = {$ans}\n"; // Output: 20.5 / 1 = 20.5
Output for git.master, git.master_jit, rfc.property-hooks
XML Test: 20.5 / 1 = 20.5 20.5 / 1 = 20.5 String Test: 20.5 / 1 = 20.5

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:
39.6 ms | 401 KiB | 8 Q