3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = obterCoordenadas("80630-000"); echo $x; function obterCoordenadas($cep) { $url = "https://nominatim.openstreetmap.org/search?format=json&q=" . $cep; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, "https://catalogodigital.webcontrolempresas.com.br"); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); if (!empty($data)) { return [$data[0]['lon'], $data[0]['lat']]; } else { return false; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/s4rdL:10 Stack trace: #0 /in/s4rdL(3): obterCoordenadas('80630-000') #1 {main} thrown in /in/s4rdL on line 10
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:
35.41 ms | 405 KiB | 5 Q