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'));

preferences:
47.53 ms | 402 KiB | 5 Q