3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = file_get_contents('http://gamesurf.tiscali.it/dynamic/articolo/CHIAVE/fina1294224760111/TIPO_PAGINA/recensione'); $dom = new DOMDocument(); @$dom->loadHTML($data); $span = $dom->getElementsByTagName('span'); $paragraph = $dom->getElementsByTagName('p'); $startList = '<ol type="1">'; $endList = '</ol>'; $tBox = array(); $pBox = array(); foreach ($span as $s) { if ($s->hasAttribute('class') && $s->getAttribute('class') == 'boxtitle2') { array_push($tBox,$dom->saveHTML($s)); } } foreach ($paragraph as $p) { if ($p->hasAttribute('class') && $p->getAttribute('class') == 'boxp') { array_push($pBox,html_entity_decode($dom->saveHTML($p))); } } if (!empty($tBox) && !empty($pBox)) { foreach ($tBox as $k => $v) { $commento = $commento.'<li>'.$v.' - '.htmlentities($pBox[$k]).'</li>'; } $commento = $startList.$commento.$endList; } echo $commento; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for gamesurf.tiscali.it failed: System error in /in/GdsQE on line 2 Warning: file_get_contents(http://gamesurf.tiscali.it/dynamic/articolo/CHIAVE/fina1294224760111/TIPO_PAGINA/recensione): Failed to open stream: php_network_getaddresses: getaddrinfo for gamesurf.tiscali.it failed: System error in /in/GdsQE on line 2 Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /in/GdsQE:4 Stack trace: #0 /in/GdsQE(4): DOMDocument->loadHTML('') #1 {main} thrown in /in/GdsQE on line 4
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:
46.59 ms | 402 KiB | 8 Q