3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "What do you carry in your purse/wallet?"; $numbertoscan = 5; $query = str_replace(' ', '%20', $input); $i=0; while($i<$numbertoscan){ $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=".$query."&start=".$i*4; $body = file_get_contents($url); $json = json_decode($body); for($x=0;$x<count($json->responseData->results);$x++){ //echo "<b>Result ".($x+1)."</b>"; //echo "<br>URL: "; // $json->responseData->results[$x]->url; //echo "<br>VisibleURL: "; //echo $json->responseData->results[$x]->visibleUrl; //echo "<br>Title: "; //echo $json->responseData->results[$x]->title; //echo "<br>Content: "; if (strpos($json->responseData->results[$x]->content,' i ') !== false) { echo $json->responseData->results[$x]->content; echo "<br><br>"; } } $i++; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for ajax.googleapis.com failed: System error in /in/0BGsi on line 9 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=What%20do%20you%20carry%20in%20your%20purse/wallet?&start=0): Failed to open stream: php_network_getaddresses: getaddrinfo for ajax.googleapis.com failed: System error in /in/0BGsi on line 9 Warning: Attempt to read property "responseData" on null in /in/0BGsi on line 11 Warning: Attempt to read property "results" on null in /in/0BGsi on line 11 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/0BGsi:11 Stack trace: #0 {main} thrown in /in/0BGsi on line 11
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:
56.2 ms | 402 KiB | 8 Q