3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 8.3.0 - 8.3.4, 8.3.6 - 8.3.7
Warning: Undefined variable $token in /in/8QmK4 on line 2 Warning: Trying to access array offset on null in /in/8QmK4 on line 2 Warning: Undefined variable $userInfo in /in/8QmK4 on line 3 Warning: Trying to access array offset on null in /in/8QmK4 on line 3 Warning: 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 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined variable $token in /in/8QmK4 on line 2 Warning: Trying to access array offset on null in /in/8QmK4 on line 2 Warning: Undefined variable $userInfo in /in/8QmK4 on line 3 Warning: Trying to access array offset on null in /in/8QmK4 on line 3 Warning: 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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: Undefined variable $token in /in/8QmK4 on line 2 Warning: Trying to access array offset on value of type null in /in/8QmK4 on line 2 Warning: Undefined variable $userInfo in /in/8QmK4 on line 3 Warning: Trying to access array offset on value of type null in /in/8QmK4 on line 3 Warning: 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 7.4.0 - 7.4.33
Notice: Undefined variable: token in /in/8QmK4 on line 2 Notice: Trying to access array offset on value of type null in /in/8QmK4 on line 2 Notice: Undefined variable: userInfo in /in/8QmK4 on line 3 Notice: Trying to access array offset on value of type null 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 7.3.32 - 7.3.33
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 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
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.

preferences:
169.05 ms | 402 KiB | 174 Q