3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $access_token = $token['access_token']; $owner_id = $userInfo['uid']; $message = '🔥 Я во ВКонтакте уже '.$days.' дней!'.PHP_EOL.'🚩Узнай и ты свой возраст в ВК:'.PHP_EOL.'🆗 '; function postMessage($access_token,$owner_id,$message){ $request = "https://api.vkontakte.ru/method/wall.post"; $params = array('owner_id' => $owner_id,'message' => $message,'access_token' => $access_token); $result = callMethod($request, $params); return $result; } function callMethod($request, $params){$c=curl_init(); curl_setopt($c, CURLOPT_URL, $request); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $params); curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($c, CURLOPT_TIMEOUT, 30); $result=curl_exec($c); curl_close($c); return $result; } postMessage( $access_token,$owner_id,$message);
based on 89SQJ
Output for 7.0.0 - 7.2.6
Notice: Undefined variable: token in /in/8QmK4 on line 2 Notice: Undefined variable: userInfo in /in/8QmK4 on line 3 Notice: Undefined variable: days in /in/8QmK4 on line 4 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/8QmK4:12 Stack trace: #0 /in/8QmK4(9): callMethod('https://api.vko...', Array) #1 /in/8QmK4(24): postMessage(NULL, NULL, '\xF0\x9F\x94\xA5 \xD0\xAF \xD0\xB2\xD0\xBE \xD0\x92...') #2 {main} thrown in /in/8QmK4 on line 12
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: token in /in/8QmK4 on line 2 Notice: Undefined variable: userInfo in /in/8QmK4 on line 3 Notice: Undefined variable: days in /in/8QmK4 on line 4
Output for 5.6.0 - 5.6.30
Notice: Undefined variable: token in /in/8QmK4 on line 2 Notice: Undefined variable: userInfo in /in/8QmK4 on line 3 Notice: Undefined variable: days in /in/8QmK4 on line 4 Fatal error: Call to undefined function curl_init() in /in/8QmK4 on line 12
Process exited with code 255.