3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $url = "https://mega.nz/#!PFdyDJaB!Ju3MUq68FV3YiEr2aqmFGqXMgl-1-gr0ORN0oBrNXWQ"; preg_match("/!(.+?)!/", $url, $output_array); $fileID = $output_array[1]; $domain = "meganz"; $lang = "en"; $apiURL = "https://eu.api.mega.co.nz/cs?domain=$domain&lang=$lang"; $value = array( array( 'a' => 'g', 'g' => 1, 'ssl' => 0, //0, 1, 2 (default is 2) 'p' => $fileID) // File id here ); $rawPOST = json_encode($value); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apiURL ); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch, CURLOPT_POST, true ); curl_setopt($ch, CURLOPT_POSTFIELDS, $rawPOST ); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36'); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain;charset=UTF-8')); $result=curl_exec($ch); $jsonResult = json_decode($result); $directLink = $jsonResult[0]->g; $fileSize = $jsonResult[0]->s; echo "URL: $directLink"; echo '<br>'; echo "File Size: $fileSize bytes"; echo '<br>'; ?>
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.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6

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
Process exited with code 255.

preferences:
148.84 ms | 401 KiB | 173 Q