3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "https://m.naughtyappetite.com/oth.php?dynamicpage=all_1cm_universal_light_n&ver=1"; $urlParams = array( 'source', 'transfer_to', 'ban_rm', 'pop_rm', 'txt_rm', 'zoneid', 'userid', 'userId', 'ver', 't_uod', 't_umbr', 'email', 'emlTrack', 'key', 'uniqmessageId', 'open', 'transferSource', 'cmpn', 'loc', 'cross', 'crossMask', '_cbUrl', '_disAL', '_fData', 'utm_partner', 'clkid', 'clid', 'clbid', 'safeLP', 'campaigntype', 'redirectUrl', ); function getParam($key) { $url = "http://www.thirst-more.com/2207/campaign32813?safeLP=naughty&source=www.benaughty.com&transfer_to=naughtyappetite.com&ban_rm=000748865&zoneid=4661&userId=c078c5c84f7311e79a97441ea14ed80c&key=c7eee25af7c437abaf37c460b8d1f467&clid=927&clbid=33872&location=UKR&remType=Banner&targetSite=6747c8fb5b73abce100992b51af15eef"; $query = parse_url($url, PHP_URL_QUERY); parse_str($query, $params); return isset($params[$key]) ? $params[$key] : null; } $params = array_fill_keys($urlParams, ""); array_walk($params, function(&$item, $key){ $item = self::getParam($key); }); $params = array_filter($params); die(var_dump($params));
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Cannot access "self" when no class scope is active in /in/hZttH:46 Stack trace: #0 [internal function]: {closure}('', 'source') #1 /in/hZttH(45): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/hZttH on line 46
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 Fatal error: Uncaught Error: Cannot access "self" when no class scope is active in /in/hZttH:46 Stack trace: #0 [internal function]: {closure}('', 'source') #1 /in/hZttH(45): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/hZttH on line 46
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Fatal error: Uncaught Error: Cannot access "self" when no class scope is active in /in/hZttH:46 Stack trace: #0 [internal function]: {closure}('', 'source') #1 /in/hZttH(47): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/hZttH on line 46
Process exited with code 255.
Output for 7.3.24 - 7.3.33, 7.4.12 - 7.4.33
Fatal error: Uncaught Error: Cannot access self:: when no class scope is active in /in/hZttH:46 Stack trace: #0 [internal function]: {closure}('', 'source') #1 /in/hZttH(47): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/hZttH on line 46
Process exited with code 255.

preferences:
101.11 ms | 402 KiB | 118 Q