3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urls = array('www.roi.ru/api/petition/309.json', 'www.roi.ru/api/petition/401.json'); $urls2 = array('api.vkontakte.ru/method/users.get?uids=1', 'api.vkontakte.ru/method/users.get?uids=2'); $cmh = curl_multi_init(); $tasks = array(); foreach ($urls2 as $url) { $ch = curl_init('https://'.$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $tasks[$url] = $ch; curl_multi_add_handle($cmh, $ch); } $active = null; do { $mrc = curl_multi_exec($cmh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && ($mrc == CURLM_OK)) { if (curl_multi_select($cmh) != -1) { do { $mrc = curl_multi_exec($cmh, $active); $info = curl_multi_info_read($cmh); if ($info['msg'] == CURLMSG_DONE) { $ch = $info['handle']; $url = array_search($ch, $tasks); $tasks[$url] = curl_multi_getcontent($ch); curl_multi_remove_handle($cmh, $ch); curl_close($ch); } } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } curl_multi_close($cmh); echo "<br><pre>"; var_dump($tasks); echo "</pre>"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_multi_init() in /in/spkev:5 Stack trace: #0 {main} thrown in /in/spkev on line 5
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:
58.59 ms | 401 KiB | 8 Q