3v4l.org

run code in 300+ PHP versions simultaneously
<?php $movie = "http://captainamericacivilwarmovie.pro/"; function scrape($URL){ //cURL options $options = Array( CURLOPT_RETURNTRANSFER => TRUE, //return html data in string instead of printing it out on screen CURLOPT_FOLLOWLOCATION => TRUE, //follow header('Location: location'); CURLOPT_CONNECTTIMEOUT => 60, //max time to try to connect to page CURLOPT_HEADER => FALSE, //include header CURLOPT_REFERER => 'http://captainamericacivilwarmovie.pro/', CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0", //User Agent CURLOPT_URL => $URL //SET THE URL ); $ch = curl_init($URL); curl_setopt_array($ch, $options); $data = curl_exec($ch); curl_close($ch); preg_match_all('/<iframe .* src=\"(.*?)\" .*><\/iframe>/', $data, $matches); $retData=''; echo '<pre>'; print_r( $matches); echo '</pre>'; if($matches[1][1] != null){ $retData=$matches[1][1]; }else if($matches[1][0] != null){ $retData=$matches[1][0]; }else $retData=''; echo $retData; } scrape($movie); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Undefined constant "CURLOPT_RETURNTRANSFER" in /in/k0ufc:7 Stack trace: #0 /in/k0ufc(41): scrape('http://captaina...') #1 {main} thrown in /in/k0ufc on line 7
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 7 Warning: Use of undefined constant CURLOPT_FOLLOWLOCATION - assumed 'CURLOPT_FOLLOWLOCATION' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 8 Warning: Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 9 Warning: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 10 Warning: Use of undefined constant CURLOPT_REFERER - assumed 'CURLOPT_REFERER' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 11 Warning: Use of undefined constant CURLOPT_USERAGENT - assumed 'CURLOPT_USERAGENT' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 12 Warning: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' (this will throw an Error in a future version of PHP) in /in/k0ufc on line 13 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/k0ufc:15 Stack trace: #0 /in/k0ufc(41): scrape('http://captaina...') #1 {main} thrown in /in/k0ufc on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /in/k0ufc on line 7 Notice: Use of undefined constant CURLOPT_FOLLOWLOCATION - assumed 'CURLOPT_FOLLOWLOCATION' in /in/k0ufc on line 8 Notice: Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' in /in/k0ufc on line 9 Notice: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' in /in/k0ufc on line 10 Notice: Use of undefined constant CURLOPT_REFERER - assumed 'CURLOPT_REFERER' in /in/k0ufc on line 11 Notice: Use of undefined constant CURLOPT_USERAGENT - assumed 'CURLOPT_USERAGENT' in /in/k0ufc on line 12 Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /in/k0ufc on line 13 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/k0ufc:15 Stack trace: #0 /in/k0ufc(41): scrape('http://captaina...') #1 {main} thrown in /in/k0ufc on line 15
Process exited with code 255.
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /in/k0ufc on line 7 Notice: Use of undefined constant CURLOPT_FOLLOWLOCATION - assumed 'CURLOPT_FOLLOWLOCATION' in /in/k0ufc on line 8 Notice: Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' in /in/k0ufc on line 9 Notice: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' in /in/k0ufc on line 10 Notice: Use of undefined constant CURLOPT_REFERER - assumed 'CURLOPT_REFERER' in /in/k0ufc on line 11 Notice: Use of undefined constant CURLOPT_USERAGENT - assumed 'CURLOPT_USERAGENT' in /in/k0ufc on line 12 Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /in/k0ufc on line 13 Fatal error: Call to undefined function curl_init() in /in/k0ufc on line 15
Process exited with code 255.

preferences:
202.98 ms | 402 KiB | 255 Q