3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <translations> <translation id="title"> <english name="name1" ad="ad1">Hello there, how are you?</english> <italian name="name2" ad="ad2">Ciao, come stai?</italian> </translation> <translation id="text2"> <english name="name3" ad="ad4">222Hello there, how are you?</english> <italian name="name3" ad="ad4">222Ciao, come stai?</italian> </translation> <translation id="text3"> <english name="name5" ad="ad5">333Hello there, how are you?</english> <italian name="name6" ad="ad6">333Ciao, come stai?</italian> </translation> </translations>'; $xml = new SimpleXMLElement($xml); var_dump($xml->translations); echo $xml->translations->translation->english['ad']; echo $xml->translations->translation->italian['name'];
Output for git.master, git.master_jit
object(SimpleXMLElement)#2 (0) { } Warning: Attempt to read property "english" on null in /in/pFtU2 on line 24 Warning: Trying to access array offset on value of type null in /in/pFtU2 on line 24 Warning: Attempt to read property "italian" on null in /in/pFtU2 on line 25 Warning: Trying to access array offset on value of type null in /in/pFtU2 on line 25
Output for rfc.property-hooks
object(SimpleXMLElement)#2 (0) { } Warning: Attempt to read property "english" on null in /in/pFtU2 on line 24 Warning: Trying to access array offset on null in /in/pFtU2 on line 24 Warning: Attempt to read property "italian" on null in /in/pFtU2 on line 25 Warning: Trying to access array offset on null in /in/pFtU2 on line 25

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