3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* I somehow want this part..: $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIE, "birthtime=28801; path=/; domain=store.steampowered.com"); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); *///To be sent with the DomXPath part, so the DOM fetches the site with the cookie placed to avoid age restriction - // - blocking it from fetching the description. // Need I execute the DOM using $result (tried that, failed miserably), or is there another way? $url = "http://store.steampowered.com/app/100"; $dom = new domDocument; libxml_use_internal_errors(true); $dom->loadHTMLFile($url); $classname="game_description_snippet"; $finder = new DomXPath($dom); $spaner = $finder->query("//*[contains(@class, '$classname')]"); foreach ($spaner as $spane) { $spanx = $spane->childNodes; $description = $spanx->item(0)->nodeValue; $GLOBALS['x'] = $description; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo for store.steampowered.com failed: System error in /in/Yhnln on line 20 Warning: DOMDocument::loadHTMLFile(http://store.steampowered.com/app/100): Failed to open stream: php_network_getaddresses: getaddrinfo for store.steampowered.com failed: System error in /in/Yhnln on line 20

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:
53.33 ms | 402 KiB | 8 Q