3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function decode_char2($c) { $a1 = array("0", "1", "2", "3", "4", "5", "6", "7", "9", "H", "M", "D", "X", "V", "J", "Q", "U", "G", "E", "T", "N", "o", "v", "y", "w", "k"); $a2 = array("c", "I", "W", "m", "8", "L", "l", "g", "R", "B", "a", "u", "s", "p", "z", "Z", "e", "d", "=", "x", "Y", "t", "n", "f", "b", "i"); $result = $c; for($j = 0; $j < count($a1); $j++) { if ($c == $a1[$j][0]) { $result = $a2[$j][0]; break; } if ($c == $a2[$j][0]) { $result = $a1[$j][0]; break; } } return $result; } function reverse($s, $direct) { if ($direct == 'd') { $nlen = strlen($s)-3; $r = ''; while ($nlen > 2) { $r .= substr($s,$nlen,1); $nlen--; } $nlen = strlen($r); $nlen2 = intval(substr($s,1,1).substr($s,0,1)); $nlen2 = $nlen2 / 2; if ($nlen2 < $nlen) { $npos = $nlen2; while ($npos < $nlen) { $r = substr($r,0, $npos) . substr($r,$npos + 1); $npos += $nlen2; } } } else { $nlen = strlen($s); $delta = 7; if (($nlen % $delta) == 0) $delta = 8; $s0 = $s; $s7 = substr($s0,0,$delta); $s0 = substr($s0,$delta); $s = ''; while ((strlen($s7) == $delta) && (strlen($s0) > 0)) { $s .= $s7 . 'd'; $s7 = substr($s0,0,$delta); $s0 = substr($s0,$delta); } $s .= $s7; $nlen = strlen($s)-1; $r = ''; while ($nlen >= 0) { $r .= substr($s,$nlen,1); $nlen--; } $delta2 = $delta + $delta; $sdelta2 = "$delta2"; $sdelta4 = substr($sdelta2,1,1) . substr($sdelta2,0,1); $r = $sdelta4 . 'A' . $r . 'rs'; } return($r); } function decode_str2($s) { $s = reverse($s,"d"); $result = ''; for($i = 0; $i < strlen($s); $i++) { $result .= decode_char2($s[$i]); } $result = base64_decode($result); return $result; } function encode_str2($s) { $s = base64_encode($s); $result = ''; for($i = 0; $i < strlen($s); $i++) { $result .= decode_char2($s[$i]); } $result = reverse($result,"e"); return $result; } echo decode_str2("2iob3gRLvctM31EMtgTM25k40Cm=2xmLkasB05wbv1GjttQ3N1AbOxFjkjy5OdE1UjANtjwhkgTakQtWydnbtgGjvc9h0SJ52xWM3NJR3QnL3dJ1GI4h3ayRkxmB6fZMtjAWyCm50iUr");
based on 4VpdU
Output for 5.3.9 - 7.1.0

Process exited with code 137.