3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 並列通信用マルチハンドルを用意 $mh = curl_multi_init(); // 通信先ごとにCurl Handleを作り、それを $mh にaddしていく $ch_news = curl_init("http://dailynews.yahoo.co.jp/fc/entertainment/rss.xml"); curl_setopt($ch_news, CURLOPT_RETURNTRANSFER, TRUE); curl_multi_add_handle($mh, $ch_news); // 同様に $ch_music = curl_init("http://magazine.music.yahoo.co.jp/rss/ALL/rss.xml"); curl_setopt($ch_music, CURLOPT_RETURNTRANSFER, TRUE); curl_multi_add_handle($mh, $ch_music); // 同様に $ch_trend = curl_init("http://searchranking.yahoo.co.jp/rss/trend-rss.xml"); curl_setopt($ch_trend, CURLOPT_RETURNTRANSFER, TRUE); curl_multi_add_handle($mh, $ch_trend); // せーので複数の通信を同時実行。whileで全て返ってくるのを待ちます do { curl_multi_exec($mh, $running); } while ( $running ); // 個々のXMLは、それぞれのCurl Handleを指定することで取得できる $rss_news = curl_multi_getcontent($ch_news); $rss_music = curl_multi_getcontent($ch_music); $rss_trend = curl_multi_getcontent($ch_trend); // 後始末 curl_multi_remove_handle($mh, $ch_news); curl_close($ch_news); curl_multi_remove_handle($mh, $ch_music); curl_close($ch_music); curl_multi_remove_handle($mh, $ch_trend); curl_close($ch_trend); curl_multi_close($mh);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_multi_init() in /in/8edIq:4 Stack trace: #0 {main} thrown in /in/8edIq 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:
53.59 ms | 401 KiB | 8 Q