3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $html = "http://www.margonem.pl/?task=clanrank&w=infinity"; $xml = new DOMDocument(); $xml->validateOnParse = true; $xml->loadHTML(file_get_contents($html)); $xpath = new DOMXPath($xml); $table =$xpath->query("//*[@id='ranking']")->item(0); $rows = $table->getElementsByTagName("tr"); foreach ($rows as $row) { $cells = $row -> getElementsByTagName('td'); foreach ($cells as $cell) { print $cell->nodeValue; } }
Output for 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Uncaught Error: Call to a member function getElementsByTagName() on null in /in/7CdhG:8 Stack trace: #0 {main} thrown in /in/7CdhG on line 8
Process exited with code 255.
Output for 7.0.4
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Uncaught Error: Call to a member function getElementsByTagName() on null in /in/7CdhG:8 Stack trace: #0 {main} thrown in /in/7CdhG on line 8
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Failed to open http://www.margonem.pl/?task=clanrank&w=infinity (Could not resolve host: www.margonem.pl) in /in/7CdhG on line 5 Warning: Empty string supplied as input Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getElementsByTagName() on a non-object (null)' in /in/7CdhG:8 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.7 - 5.6.17, 5.6.20 - 5.6.28
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on null in /in/7CdhG on line 8
Process exited with code 255.
Output for 5.6.18 - 5.6.19
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on null in /in/7CdhG on line 8
Process exited with code 255.
Output for 5.2.6 - 5.4.34, 5.5.24 - 5.5.32, 5.5.34 - 5.5.35
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/7CdhG on line 8
Process exited with code 255.
Output for 5.4.35 - 5.4.45, 5.5.33
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/7CdhG on line 8
Process exited with code 255.
Output for 5.0.3 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: Connection refused in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/7CdhG on line 8
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: Success in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/7CdhG on line 8
Process exited with code 255.
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/7CdhG on line 5 Warning: file_get_contents(http://www.margonem.pl/?task=clanrank&w=infinity): failed to open stream: Bad file descriptor in /in/7CdhG on line 5 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/7CdhG on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/7CdhG on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/7CdhG on line 7
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 in /in/7CdhG on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/7CdhG on line 7
Process exited with code 255.