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->(string)xpath("//Row/Cell[3]/Data"); foreach ($countries as $c) echo "$c, ";
Output for 5.4.16
Parse error: syntax error, unexpected '(string)' (string) (T_STRING_CAST), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/Q3IuG on line 40
Process exited with code 255.
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '(string)' (string) (T_STRING_CAST), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in 7Ksch on line 40
Process exited with code 255.
Output for 5.3.25 - 5.3.26
Parse error: syntax error, unexpected T_STRING_CAST, expecting T_STRING or T_VARIABLE or '{' or '$' in /in/Q3IuG on line 40
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_STRING_CAST, expecting T_STRING or T_VARIABLE or '{' or '$' in 7Ksch on line 40
Process exited with code 255.

preferences:
182.35 ms | 1395 KiB | 51 Q