3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <XL> <Row> <Cell><Data Type="String">Dr. nair</Data></Cell> <Cell><Data Type="String">12121 brok Blvd. </Data></Cell> <Cell><Data Type="String">WEST INDIES</Data></Cell> <Cell><Data Type="String">WI</Data></Cell> <Cell><Data Type="Number">90025</Data></Cell> <Cell><Data Type="String">310-444-1212</Data></Cell> </Row> <Row> <Cell><Data Type="String">Dr. july</Data></Cell> <Cell><Data Type="String">Paldi. </Data></Cell> <Cell><Data Type="String">WEST INDIES</Data></Cell> <Cell><Data Type="String">WI</Data></Cell> <Cell><Data Type="Number">90025</Data></Cell> <Cell><Data Type="String">310-4544-1212</Data></Cell> </Row> <Row> <Cell><Data Type="String">Dr. lol</Data></Cell> <Cell><Data Type="String">Paldi. </Data></Cell> <Cell><Data Type="String">New Zeland</Data></Cell> <Cell><Data Type="String">NZ</Data></Cell> <Cell><Data Type="Number">90025</Data></Cell> <Cell><Data Type="String">310-4544-1212</Data></Cell> </Row> <Row> <Cell><Data Type="String">Dr. nik</Data></Cell> <Cell><Data Type="String">Paldi. </Data></Cell> <Cell><Data Type="String">India</Data></Cell> <Cell><Data Type="String">IN</Data></Cell> <Cell><Data Type="Number">90025</Data></Cell> <Cell><Data Type="String">310-4544-1212</Data></Cell> </Row> </XL> XML; $xml = simplexml_load_string($x); $countries = $xml->xpath("//Row/Cell/Data"); var_dump($countries);
Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.29 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
array(24) { [0]=> object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(8) "Dr. nair" } [1]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(17) "12121 brok Blvd. " } [2]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(11) "WEST INDIES" } [3]=> object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "WI" } [4]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [5]=> object(SimpleXMLElement)#7 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(12) "310-444-1212" } [6]=> object(SimpleXMLElement)#8 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(8) "Dr. july" } [7]=> object(SimpleXMLElement)#9 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Paldi. " } [8]=> object(SimpleXMLElement)#10 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(11) "WEST INDIES" } [9]=> object(SimpleXMLElement)#11 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "WI" } [10]=> object(SimpleXMLElement)#12 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [11]=> object(SimpleXMLElement)#13 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(13) "310-4544-1212" } [12]=> object(SimpleXMLElement)#14 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Dr. lol" } [13]=> object(SimpleXMLElement)#15 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Paldi. " } [14]=> object(SimpleXMLElement)#16 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(10) "New Zeland" } [15]=> object(SimpleXMLElement)#17 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "NZ" } [16]=> object(SimpleXMLElement)#18 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [17]=> object(SimpleXMLElement)#19 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(13) "310-4544-1212" } [18]=> object(SimpleXMLElement)#20 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Dr. nik" } [19]=> object(SimpleXMLElement)#21 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Paldi. " } [20]=> object(SimpleXMLElement)#22 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(5) "India" } [21]=> object(SimpleXMLElement)#23 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "IN" } [22]=> object(SimpleXMLElement)#24 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [23]=> object(SimpleXMLElement)#25 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(13) "310-4544-1212" } }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array(24) { [0]=> object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(8) "Dr. nair" } [1]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(17) "12121 brok Blvd. " } [2]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(11) "WEST INDIES" } [3]=> object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "WI" } [4]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [5]=> object(SimpleXMLElement)#7 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(12) "310-444-1212" } [6]=> object(SimpleXMLElement)#8 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(8) "Dr. july" } [7]=> object(SimpleXMLElement)#9 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Paldi. " } [8]=> object(SimpleXMLElement)#10 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(11) "WEST INDIES" } [9]=> object(SimpleXMLElement)#11 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "WI" } [10]=> object(SimpleXMLElement)#12 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [11]=> object(SimpleXMLElement)#13 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(13) "310-4544-1212" } [12]=> object(SimpleXMLElement)#14 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Dr. lol" } [13]=> object(SimpleXMLElement)#15 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Paldi. " } [14]=> object(SimpleXMLElement)#16 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(10) "New Zeland" } [15]=> object(SimpleXMLElement)#17 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "NZ" } [16]=> object(SimpleXMLElement)#18 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [17]=> object(SimpleXMLElement)#19 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(13) "310-4544-1212" } [18]=> object(SimpleXMLElement)#20 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Dr. nik" } [19]=> object(SimpleXMLElement)#21 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(7) "Paldi. " } [20]=> object(SimpleXMLElement)#22 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(5) "India" } [21]=> object(SimpleXMLElement)#23 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(2) "IN" } [22]=> object(SimpleXMLElement)#24 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "Number" } [0]=> string(5) "90025" } [23]=> object(SimpleXMLElement)#25 (2) { ["@attributes"]=> array(1) { ["Type"]=> string(6) "String" } [0]=> string(13) "310-4544-1212" } }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
array(24) { [0]=> object(SimpleXMLElement)#2 (1) { [0]=> string(8) "Dr. nair" } [1]=> object(SimpleXMLElement)#3 (1) { [0]=> string(17) "12121 brok Blvd. " } [2]=> object(SimpleXMLElement)#4 (1) { [0]=> string(11) "WEST INDIES" } [3]=> object(SimpleXMLElement)#5 (1) { [0]=> string(2) "WI" } [4]=> object(SimpleXMLElement)#6 (1) { [0]=> string(5) "90025" } [5]=> object(SimpleXMLElement)#7 (1) { [0]=> string(12) "310-444-1212" } [6]=> object(SimpleXMLElement)#8 (1) { [0]=> string(8) "Dr. july" } [7]=> object(SimpleXMLElement)#9 (1) { [0]=> string(7) "Paldi. " } [8]=> object(SimpleXMLElement)#10 (1) { [0]=> string(11) "WEST INDIES" } [9]=> object(SimpleXMLElement)#11 (1) { [0]=> string(2) "WI" } [10]=> object(SimpleXMLElement)#12 (1) { [0]=> string(5) "90025" } [11]=> object(SimpleXMLElement)#13 (1) { [0]=> string(13) "310-4544-1212" } [12]=> object(SimpleXMLElement)#14 (1) { [0]=> string(7) "Dr. lol" } [13]=> object(SimpleXMLElement)#15 (1) { [0]=> string(7) "Paldi. " } [14]=> object(SimpleXMLElement)#16 (1) { [0]=> string(10) "New Zeland" } [15]=> object(SimpleXMLElement)#17 (1) { [0]=> string(2) "NZ" } [16]=> object(SimpleXMLElement)#18 (1) { [0]=> string(5) "90025" } [17]=> object(SimpleXMLElement)#19 (1) { [0]=> string(13) "310-4544-1212" } [18]=> object(SimpleXMLElement)#20 (1) { [0]=> string(7) "Dr. nik" } [19]=> object(SimpleXMLElement)#21 (1) { [0]=> string(7) "Paldi. " } [20]=> object(SimpleXMLElement)#22 (1) { [0]=> string(5) "India" } [21]=> object(SimpleXMLElement)#23 (1) { [0]=> string(2) "IN" } [22]=> object(SimpleXMLElement)#24 (1) { [0]=> string(5) "90025" } [23]=> object(SimpleXMLElement)#25 (1) { [0]=> string(13) "310-4544-1212" } }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/HTNak on line 38
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/HTNak on line 38
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/HTNak on line 39
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/HTNak on line 38

preferences:
283.5 ms | 401 KiB | 347 Q