3v4l.org

run code in 300+ PHP versions simultaneously
<?php functionx get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data; } $returned_content = get_data('http://78.46.104.123:8000/feed/stoc');
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'get_data' (T_STRING) in /in/upo6A on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/upo6A on line 5
Process exited with code 255.

preferences:
185.53 ms | 1386 KiB | 67 Q