3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ua = urlencode($_SERVER['HTTP_USER_AGENT']); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://useragentapi.com/api/v4/json/APIKEY/$ua"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); $http = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); print_r($result); ?>
Output for 7.0.0 - 7.3.0alpha1
Notice: Undefined index: HTTP_USER_AGENT in /in/HS0ro on line 2 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/HS0ro:4 Stack trace: #0 {main} thrown in /in/HS0ro on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined index: HTTP_USER_AGENT in /in/HS0ro on line 2 Warning: urlencode() expects parameter 1 to be string, null given in /in/HS0ro on line 2
Output for 5.6.0 - 5.6.30
Notice: Undefined index: HTTP_USER_AGENT in /in/HS0ro on line 2 Fatal error: Call to undefined function curl_init() in /in/HS0ro on line 4
Process exited with code 255.