3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function FuckYouLinux($url) { $ch = curl_init(); $header=array('GET /1575051 HTTP/1.1', 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language:en-US,en;q=0.8', 'Cache-Control:max-age=0', 'Connection:keep-alive', 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36', ); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,0); curl_setopt($ch,CURLOPT_HTTPHEADER,$header); $result=curl_exec($ch); curl_close($ch); return $result; } function Match($str, $re) { $matches = array(); preg_match($re, $str, $matches); return count($matches) > 0 ? $matches[0] : NULL; } $args = array("id" => 77949); $data = FuckYouLinux("http://23.223.34.97/item=".$args["id"]."&power"); $item = array( "name" => "", "quality" => 0, "icon" => 0, "tooltip" => "" ); $item["name"] = Match($data, "/name_ruru: '(.+)'/"); $item["quality"] = Match($data, "/quality: '(.+)'/"); $item["icon"] = Match($data, "/icon: '(.+)'/"); $item["tooltip"] = Match($data, "/tooltip_ruru: '(.+)'/"); print(json_encode($item)); ?>
based on VmvgI
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/qXENv:5 Stack trace: #0 /in/qXENv(32): FuckYouLinux('http://23.223.3...') #1 {main} thrown in /in/qXENv on line 5
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/qXENv on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: curl_init() in /in/qXENv on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: curl_init() in /in/qXENv on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: curl_init() in /in/qXENv on line 5