3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?hh namespace Hack\UserDocumentation\Async\Intro\Examples\NonAsyncCurl; function curl_A(): mixed { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://example.com/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); return curl_exec($ch); } function curl_B(): mixed { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://example.net/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); return curl_exec($ch); } function main(): void { $start = microtime(true); $a = curl_A(); $b = curl_B(); $end = microtime(true); echo "Total time taken: " . strval($end - $start) . " seconds" . PHP_EOL; } main();
based on pVGq9
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.4
Parse error: syntax error, unexpected 'namespace' (T_NAMESPACE) in /in/vnhn1 on line 3
Process exited with code 255.
Output for hhvm-3.17.3
Total time taken: 0.0092930793762207 seconds
Output for hhvm-3.15.4
Total time taken: 0.008922815322876 seconds
Output for hhvm-3.12.14
Total time taken: 0.0088038444519043 seconds