3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(is_callable('curl_init')){ echo "Enabled"; } else { echo "Not enabled"; } $url = "https://www.google.com"; echo $url; $response = getPriceFromFlipkart($url); echo $response; function getPriceFromFlipkart($url) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 10.10; labnol;) 3v4l.org"); curl_setopt($curl, CURLOPT_FAILONERROR, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $html = curl_exec($curl); curl_close($curl); return $html; }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Not enabledhttps://www.google.com Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/9t4Vd:19 Stack trace: #0 /in/9t4Vd(13): getPriceFromFlipkart('https://www.goo...') #1 {main} thrown in /in/9t4Vd on line 19
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Not enabledhttps://www.google.com Fatal error: Call to undefined function curl_init() in /in/9t4Vd on line 19
Process exited with code 255.

preferences:
190.04 ms | 402 KiB | 223 Q