3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = '<div class="textrcolumn">&nbsp;<i><a rel="nofollow" style="color:#7ACD1B" href="http://www.szukammp3.pl" target="new">www.szukammp3.pl</a></i> - 2.95 MB - <a title = "Download : deep purple - soldier of fortune Mp3" href="url?id&#61;MTU2MjUyMTV8ODMxMDQ0"><u>Download</u></a> - <a title= "Listen to : deep purple - soldier of fortune without having to download the song!" HREF="javascript:;" onClick="niftyplayer("niftyPlayer1").loadAndPlay("http://www.szukammp3.pl/mp3/download/j8zIONFfEl/deep_purple_-_soldier_of_fortune.mp3")"><u>Listen</u></a> - <a title = "Find lyrics for deep purple - soldier of fortune" href="search?q=lyrics:deep purple - soldier of fortune"><u>Lyrics</u></a> </div><br>'; $dom=new DOMDocument(); @$dom->loadHTML($a); $divtag = $dom->getElementsByTagName('div'); foreach ($divtag as $div) { preg_match("/loadAndPlay\(\"(.*)/",$dom->saveHTML($div),$matches); var_dump($matches); //preg_match("/loadAndPlay\('(.*?)')/",$dom->saveHTML($div),$matches); /* $atagD7 = $dom->saveHTML($div); $doma=new DOMDocument(); @$doma->loadHTML($atagD7); $atagD7 = null; $doma = null; */ //var_dump($div->nodeValue); } ?>
Output for 5.3.6 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(0) { }
Output for 5.0.0 - 5.3.5
Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given in /in/XRMi9 on line 14 array(0) { }
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/XRMi9 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/XRMi9 on line 9