3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.mistermatic.it 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 for www.mistermatic.it 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> Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/mbWLu:40 Stack trace: #0 {main} thrown in /in/mbWLu on line 40
Process exited with code 255.
Output for 8.0.13 - 8.0.30
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> Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/mbWLu:40 Stack trace: #0 {main} thrown in /in/mbWLu on line 40
Process exited with code 255.
Output for 8.0.10 - 8.0.12
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution 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> Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/mbWLu:40 Stack trace: #0 {main} thrown in /in/mbWLu on line 40
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution 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> Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in /in/mbWLu:40 Stack trace: #0 {main} thrown in /in/mbWLu on line 40
Process exited with code 255.
Output for 7.2.0 - 7.2.13, 7.3.0 - 7.3.1, 7.3.32 - 7.3.33, 7.4.0, 7.4.26 - 7.4.33
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 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution 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.4.1 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.1.25
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.5.35, 5.6.8 - 5.6.17, 5.6.20 - 5.6.28, 7.0.0 - 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>

preferences:
220.35 ms | 404 KiB | 238 Q