3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = <<<XML <?xml version="1.0" encoding="utf-8"?> <posts> <post> <title>Hello World</title> <author>tacticalsk8er</author> <content>Hello world this is my blogging site</content> </post> <post> <title>Hello Again</title> <author>Nick Peterson</author> <content><![CDATA[Hello Again world this is another test for my <b>blogging site</b>]]></content> </post> </posts> XML; $xml = simplexml_load_string($x); echo $xml->posts(1)->title;
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Call to undefined method SimpleXMLElement::posts() in /in/coWM1:20 Stack trace: #0 {main} thrown in /in/coWM1 on line 20
Process exited with code 255.
Output for 5.0.0 - 5.1.1, 5.1.3 - 5.6.28
Fatal error: Call to undefined method SimpleXMLElement::posts() in /in/coWM1 on line 20
Process exited with code 255.
Output for 5.1.2
Fatal error: Call to undefined method SimpleXMLElement::posts() in /in/coWM1 on line 21
Process exited with code 255.
Output for 4.4.3 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/coWM1 on line 20
Process exited with code 255.
Output for 4.4.2
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/coWM1 on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/coWM1 on line 20
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/coWM1 on line 20
Process exited with code 255.