3v4l.org

run code in 300+ PHP versions simultaneously
<?php function vinHasRecallCode($vin, $code) { $json = file_get_contents("http://www.vw.com/s2f/vwrecall-nhtsa2/vin/$vin"); if (!$json) { throw new Exception('Error contacting API server.'); } $data = json_decode($json); if (!($data instanceof stdClass)) { throw new Exception('Malformed JSON data.'); } if (!is_array($data->recalls)) { throw new Exception('Malformed JSON schema.'); } if (empty($data->recalls)) { return false; } return in_array(strtolower($code), array_map('strtolower', $data->recalls)); } var_dump(vinHasRecallCode('3VWTL81K29M344780', '23Q2'));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.vw.com failed: System error in /in/WK4uG on line 5 Warning: file_get_contents(http://www.vw.com/s2f/vwrecall-nhtsa2/vin/3VWTL81K29M344780): Failed to open stream: php_network_getaddresses: getaddrinfo for www.vw.com failed: System error in /in/WK4uG on line 5 Fatal error: Uncaught Exception: Error contacting API server. in /in/WK4uG:7 Stack trace: #0 /in/WK4uG(26): vinHasRecallCode('3VWTL81K29M3447...', '23Q2') #1 {main} thrown in /in/WK4uG on line 7
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:
51.75 ms | 401 KiB | 8 Q