3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $contenuto = file_get_contents('http://www.mistermatic.it/api/?cc=89091203'); // echo '<pre>'.var_dump(json_decode($contenuto)).'</pre>'; $lista = json_decode($contenuto); $chiavi = array( "ad_number", "vehicle_type", "title", "sub_title", "make", "model", "version", "vehicle_class", "vehicle_category", "damaged", "first_registration_date", "mileage", "power_kw", "power_cv", "fuel_type", "color", "color_type", "price", "last_update", "description", "company_logo", "images_number" ); echo "<table border='1' cellspacing='0'>"; echo "<tr>"; for($j=0; $j<count($chiavi); $j++){ echo "<td>".$chiavi[$j]."</td>"; } echo "</tr>"; for($i=0; $i<count($lista); $i++){ $auto[$i] = (array) $lista[$i]; /* $chiavi = array_keys($auto[$i]); echo "<tr>"; for($j=0; $j<count($chiavi); $j++){ echo "<td>".$chiavi[$j]."</td>"; } echo "</tr>"; */ echo "<tr style='white-space: nowrap;'>"; for($j=0; $j<count($chiavi); $j++){ $chiave = $chiavi[$j]; echo "<td>".$auto[$i][$chiave]."</td>"; } echo "</tr>"; } echo "</table>"; ?>
Output for 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/mbWLu on line 3 Warning: file_get_contents(http://www.mistermatic.it/api/?cc=89091203): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/mbWLu on line 3 <table border='1' cellspacing='0'><tr><td>ad_number</td><td>vehicle_type</td><td>title</td><td>sub_title</td><td>make</td><td>model</td><td>version</td><td>vehicle_class</td><td>vehicle_category</td><td>damaged</td><td>first_registration_date</td><td>mileage</td><td>power_kw</td><td>power_cv</td><td>fuel_type</td><td>color</td><td>color_type</td><td>price</td><td>last_update</td><td>description</td><td>company_logo</td><td>images_number</td></tr> Warning: count(): Parameter must be an array or an object that implements Countable in /in/mbWLu on line 40 </table>
Output for 5.3.18 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.1.10
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/mbWLu on line 3 Warning: file_get_contents(http://www.mistermatic.it/api/?cc=89091203): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/mbWLu on line 3 <table border='1' cellspacing='0'><tr><td>ad_number</td><td>vehicle_type</td><td>title</td><td>sub_title</td><td>make</td><td>model</td><td>version</td><td>vehicle_class</td><td>vehicle_category</td><td>damaged</td><td>first_registration_date</td><td>mileage</td><td>power_kw</td><td>power_cv</td><td>fuel_type</td><td>color</td><td>color_type</td><td>price</td><td>last_update</td><td>description</td><td>company_logo</td><td>images_number</td></tr></table>
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/mbWLu on line 3 Warning: file_get_contents(http://www.mistermatic.it/api/?cc=89091203): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/mbWLu on line 3 <table border='1' cellspacing='0'><tr><td>ad_number</td><td>vehicle_type</td><td>title</td><td>sub_title</td><td>make</td><td>model</td><td>version</td><td>vehicle_class</td><td>vehicle_category</td><td>damaged</td><td>first_registration_date</td><td>mileage</td><td>power_kw</td><td>power_cv</td><td>fuel_type</td><td>color</td><td>color_type</td><td>price</td><td>last_update</td><td>description</td><td>company_logo</td><td>images_number</td></tr></table>