3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('clientId' => 5, 'userId'=>12); $name_map = array( 'clientId' => 'cid', 'userId' => 'uid', 'eventCategory' => 'ec', 'eventAction' => 'ea', 'eventLabel' => 'el', 'eventValue' => 'ev', 'nonInteraction' => 'ni', 'nonInteractive' => 'ni', 'documentPath' => 'dp', 'documentTitle' => 'dt', 'title' => 'dt', 'path' => 'dp', 'page' => 'dp', 'location' => 'dl', 'documentLocation' => 'dl', 'hostname' => 'dh', 'documentHostname' => 'dh', 'sessionControl' => 'sc', 'referrer' => 'dr', 'documentReferrer' => 'dr', 'queueTime' => 'qt', 'campaignName' => 'cn', 'campaignSource' => 'cs', 'campaignMedium' => 'cm', 'campaignKeyword' => 'ck', 'campaignContent' => 'cc', 'campaignId' => 'ci', 'screenResolution' => 'sr', 'viewportSize' => 'vp', 'documentEncoding' => 'de', 'screenColors' => 'sd', 'userLanguage' => 'ul', 'appName' => 'an', 'contentDescription' => 'cd', 'appVersion' => 'av', 'transactionAffiliation' => 'ta', 'transactionId' => 'ti', 'transactionRevenue' => 'tr', 'transactionShipping' => 'ts', 'transactionTax' => 'tt', 'transactionCurrency' => 'cu', 'itemName' => 'in', 'itemPrice' => 'ip', 'itemQuantity' => 'iq', 'itemCode' => 'ic', 'itemVariation' => 'iv', 'itemCategory' => 'iv', 'socialAction' => 'sa', 'socialNetwork' => 'sn', 'socialTarget' => 'st', 'exceptionDescription' => 'exd', 'exceptionFatal' => 'exf', 'timingCategory' => 'utc', 'timingVariable' => 'utv', 'timingTime' => 'utt', 'timingLabel' => 'utl', 'timingDNS' => 'dns', 'timingPageLoad' => 'pdt', 'timingRedirect' => 'rrt', 'timingTCPConnect' => 'tcp', 'timingServerResponse' => 'srt' ); $name_map_re = array( '@^dimension([0-9]+)$@' => 'cd$1', '@^metric([0-9]+)$@' => 'cm$1' ); $result_keys_in = array_keys($data); $result_keys = str_replace(array_keys($name_map), array_values($name_map), $result_keys_in); //$result_keys = preg_replace(array_keys($name_map_re), array_values($name_map_re), $result_keys); var_dump($result_keys);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> string(3) "cid" [1]=> string(3) "uid" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.56 ms | 401 KiB | 8 Q