3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml=simplexml_load_string(<<<XML <Records> <Record> <Row A="Constituency" B="State" C="Election date" D="Population" E="Wikipedia link" F="Election.in link" /> </Record> <Record> <Row A="Adilabad" B="Andhra Pradesh" C="4/30/2014" E="http://en.wikipedia.org/wiki/Adilabad_(Lok_Sabha_constituency)" F="http://www.elections.in/andhra-pradesh/parliamentary-constituencies/adilabad.html" /> </Record> </Records> XML ); foreach($xml->xpath('//Record') as $product) { echo $Record->A; echo "\n"; echo $Record->B; echo "\n"; echo $Record->C; echo "\n\n"; }
Output for 5.0.4 - 5.1.1, 5.1.3 - 7.1.0
Notice: Undefined variable: Record in /in/Who88 on line 28 Notice: Trying to get property of non-object in /in/Who88 on line 28 Notice: Undefined variable: Record in /in/Who88 on line 30 Notice: Trying to get property of non-object in /in/Who88 on line 30 Notice: Undefined variable: Record in /in/Who88 on line 32 Notice: Trying to get property of non-object in /in/Who88 on line 32 Notice: Undefined variable: Record in /in/Who88 on line 28 Notice: Trying to get property of non-object in /in/Who88 on line 28 Notice: Undefined variable: Record in /in/Who88 on line 30 Notice: Trying to get property of non-object in /in/Who88 on line 30 Notice: Undefined variable: Record in /in/Who88 on line 32 Notice: Trying to get property of non-object in /in/Who88 on line 32
Output for 5.1.2
Notice: Undefined variable: Record in /in/Who88 on line 29 Notice: Trying to get property of non-object in /in/Who88 on line 29 Notice: Undefined variable: Record in /in/Who88 on line 31 Notice: Trying to get property of non-object in /in/Who88 on line 31 Notice: Undefined variable: Record in /in/Who88 on line 33 Notice: Trying to get property of non-object in /in/Who88 on line 33 Notice: Undefined variable: Record in /in/Who88 on line 29 Notice: Trying to get property of non-object in /in/Who88 on line 29 Notice: Undefined variable: Record in /in/Who88 on line 31 Notice: Trying to get property of non-object in /in/Who88 on line 31 Notice: Undefined variable: Record in /in/Who88 on line 33 Notice: Trying to get property of non-object in /in/Who88 on line 33
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: Record in /in/Who88 on line 28 Notice: Trying to get property of non-object in /in/Who88 on line 28 Notice: Undefined variable: Record in /in/Who88 on line 30 Notice: Trying to get property of non-object in /in/Who88 on line 30 Notice: Undefined variable: Record in /in/Who88 on line 32 Notice: Trying to get property of non-object in /in/Who88 on line 32 Notice: Undefined variable: Record in /in/Who88 on line 28 Notice: Trying to get property of non-object in /in/Who88 on line 28 Notice: Undefined variable: Record in /in/Who88 on line 30 Notice: Trying to get property of non-object in /in/Who88 on line 30 Notice: Undefined variable: Record in /in/Who88 on line 32 Notice: Trying to get property of non-object in /in/Who88 on line 32
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/Who88 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/Who88 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/Who88 on line 2