3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php\ $rss_fandango = file_get_contents('http://www.fandango.com/rss/top10boxoffice.rss'); $xml_fandango = simplexml_load_string($rss_fandango,null, LIBXML_NOCDATA); $data_fan = $xml_fandango->channel->item; $title = $item->title; $pos = strpos($title,'$'); $final = substr($title ,3 , strpos($title,'$') - 3); $earns = substr($title, $pos, -1); echo $pos . "<br/>"; echo $final . "<br/>"; echo $earns . "<br/>";
Output for 5.3.28 - 5.3.29, 5.4.18 - 5.4.32
<?php\ $rss_fandango = file_get_contents('http://www.fandango.com/rss/top10boxoffice.rss'); $xml_fandango = simplexml_load_string($rss_fandango,null, LIBXML_NOCDATA); $data_fan = $xml_fandango->channel->item; $title = $item->title; $pos = strpos($title,'$'); $final = substr($title ,3 , strpos($title,'$') - 3); $earns = substr($title, $pos, -1); echo $pos . "<br/>"; echo $final . "<br/>"; echo $earns . "<br/>";
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
<?php\ $rss_fandango = file_get_contents('http://www.fandango.com/rss/top10boxoffice.rss'); $xml_fandango = simplexml_load_string($rss_fandango,null, LIBXML_NOCDATA); $data_fan = $xml_fandango->channel->item; $title = $item->title; $pos = strpos($title,'$'); $final = substr($title ,3 , strpos($title,'$') - 3); $earns = substr($title, $pos, -1); echo $pos . "<br/>"; echo $final . "<br/>"; echo $earns . "<br/>";