3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * Применение Google Image Api * автор: Nc_SOft * 25.11.09 */ /* Не знаю как вас, а меня изрядно подзаебали умники, продающие "воздух" под громким названием глобальный поиск картинок */ $search = 'Сиськи Семенович'; $json = file_get_contents('http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q='.urlencode($search).'&start=0'); $data = json_decode($json); //смотрим с чем имеем дело //print_r($data); //и на вывод ?><div>результатов: <?=$data->responseData->cursor->estimatedResultCount;?></div> <?php foreach ($data->responseData->results as $v) : ?> <div><a href="<?=$v->unescapedUrl;?>"><img src="<?=$v->tbUrl;?>" /></a></div> <?php endforeach;
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 <div>результатов: Notice: Trying to get property of non-object in /in/SLgn2 on line 21 Notice: Trying to get property of non-object in /in/SLgn2 on line 21 Notice: Trying to get property of non-object in /in/SLgn2 on line 21 </div> Notice: Trying to get property of non-object in /in/SLgn2 on line 22 Notice: Trying to get property of non-object in /in/SLgn2 on line 22 Warning: Invalid argument supplied for foreach() in /in/SLgn2 on line 22
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0 (Could not resolve host: ajax.googleapis.com) in /in/SLgn2 on line 14 <div>результатов: Notice: Cannot access property on non-object in /in/SLgn2 on line 21 Notice: Cannot access property on non-object in /in/SLgn2 on line 21 Notice: Cannot access property on non-object in /in/SLgn2 on line 21 </div> Notice: Cannot access property on non-object in /in/SLgn2 on line 22 Notice: Cannot access property on non-object in /in/SLgn2 on line 22 Warning: Invalid argument supplied for foreach() in /in/SLgn2 on line 24
Output for 5.2.6 - 5.3.29
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 <div>результатов: <?=$data->responseData->cursor->estimatedResultCount;?></div> Notice: Trying to get property of non-object in /in/SLgn2 on line 22 Notice: Trying to get property of non-object in /in/SLgn2 on line 22 Warning: Invalid argument supplied for foreach() in /in/SLgn2 on line 22
Output for 5.2.1 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Connection refused in /in/SLgn2 on line 14 <div>результатов: <?=$data->responseData->cursor->estimatedResultCount;?></div> Notice: Trying to get property of non-object in /in/SLgn2 on line 22 Notice: Trying to get property of non-object in /in/SLgn2 on line 22 Warning: Invalid argument supplied for foreach() in /in/SLgn2 on line 22
Output for 5.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Connection refused in /in/SLgn2 on line 14 <div>результатов: <?=$data->responseData->cursor->estimatedResultCount;?></div> Warning: Invalid argument supplied for foreach() in /in/SLgn2 on line 22
Output for 5.0.3 - 5.1.6
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Connection refused in /in/SLgn2 on line 14 Fatal error: Call to undefined function json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Success in /in/SLgn2 on line 14 Fatal error: Call to undefined function json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Bad file descriptor in /in/SLgn2 on line 14 Fatal error: Call to undefined function json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Connection refused in /in/SLgn2 on line 14 Fatal error: Call to undefined function: json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.4
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Connection refused in /in/SLgn2 on line 14 Fatal error: Call to undefined function: json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 4.3.5 - 4.3.9
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Success in /in/SLgn2 on line 14 Fatal error: Call to undefined function: json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 4.3.2
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0): failed to open stream: Connection refused in /in/SLgn2 on line 14 Fatal error: Call to undefined function: json_decode() in /in/SLgn2 on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/SLgn2 on line 14 Warning: file_get_contents(http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=large&q=%D0%A1%D0%B8%D1%81%D1%8C%D0%BA%D0%B8+%D0%A1%D0%B5%D0%BC%D0%B5%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&start=0) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/SLgn2 on line 14 Fatal error: Call to undefined function: json_decode() in /in/SLgn2 on line 15