3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cpc = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'; $std = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; $sql = '{}'; for ($i = 0; $i < 64; $i++) { $sql = str_replace('{}', 'REPLACE({}, "'.$cpc[$i].'", "'.$std[$i].'")', $sql); } echo str_replace('{}', 'TRIM(TRAILING "=" FROM TO_BASE64(UNHEX(HEX(CEIL(UNIX_TIMESTAMP(conversionTs) * 1000000)))))', $sql);
Output for 4.3.0 - 7.2.0
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM(TRAILING "=" FROM TO_BASE64(UNHEX(HEX(CEIL(UNIX_TIMESTAMP(conversionTs) * 1000000))))), "_", "_"), "-", "-"), "Z", "9"), "Y", "8"), "X", "7"), "W", "6"), "V", "5"), "U", "4"), "T", "3"), "S", "2"), "R", "1"), "Q", "0"), "P", "z"), "O", "y"), "N", "x"), "M", "w"), "L", "v"), "K", "u"), "J", "t"), "I", "s"), "H", "r"), "G", "q"), "F", "p"), "E", "o"), "D", "n"), "C", "m"), "B", "l"), "A", "k"), "z", "j"), "y", "i"), "x", "h"), "w", "g"), "v", "f"), "u", "e"), "t", "d"), "s", "c"), "r", "b"), "q", "a"), "p", "Z"), "o", "Y"), "n", "X"), "m", "W"), "l", "V"), "k", "U"), "j", "T"), "i", "S"), "h", "R"), "g", "Q"), "f", "P"), "e", "O"), "d", "N"), "c", "M"), "b", "L"), "a", "K"), "9", "J"), "8", "I"), "7", "H"), "6", "G"), "5", "F"), "4", "E"), "3", "D"), "2", "C"), "1", "B"), "0", "A")