3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = file_get_contents('http://www.google.com'); $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $query = $xpath->query("/html/body"); $body = $dom->saveXML($query->item(0)); $body = strip_tags($body); echo end(explode('Advertising Programs', $body));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.google.com failed: System error in /in/ohLe5 on line 2 Warning: file_get_contents(http://www.google.com): Failed to open stream: php_network_getaddresses: getaddrinfo for www.google.com failed: System error in /in/ohLe5 on line 2 Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /in/ohLe5 on line 3 Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /in/ohLe5:5 Stack trace: #0 /in/ohLe5(5): DOMDocument->loadHTML('') #1 {main} thrown in /in/ohLe5 on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.83 ms | 402 KiB | 8 Q