3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function checkRemoteFile($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if(curl_exec($ch)!==FALSE) { return true; } else { return false; } } $url = 'http://www.test.fr/video.mp4'; $check = checkRemoteFile($url); if(true == $check){ echo "ok"; }else{ echo "not ok"; }
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/AP09A:5 Stack trace: #0 /in/AP09A(22): checkRemoteFile('http://www.test...') #1 {main} thrown in /in/AP09A on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/AP09A on line 5
Process exited with code 255.