3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = '[https://www.quora.com]'; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); if ($result === false) { echo 'broken url'; } else { $newUrl = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); if ($newUrl !== $url) { echo 'redirect to: ' . $newUrl; } } curl_close($curl);
based on EHWuf
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/M7scW:4 Stack trace: #0 {main} thrown in /in/M7scW on line 4
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/M7scW on line 4
Process exited with code 255.