3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $r = 5; $f = 'somethingdumb'; function csc($c, $a) { if ($a < 0) { return csc($c, $a + 26); } $cd = ord($c); if (($cd >= 65) && ($cd <= 90)) { $c = chr((($cd - 65 + $a) % 26) + 65); } if (($cd >= 97) && ($cd <= 122)) { $c = chr((($cd - 97 + $a) % 26) + 97); } return $c; }; function crs($f) { global $r; $a = str_split($f); $cd = ""; for ($i=0; $i<count($a); $i++) { echo (($i+1) * $r). " | "; $cd .= csc($a[$i], ($i+1) * $r); } echo "\n"; return $cd; } function rcs($f, $o) { $a = str_split($f); $cd = ""; for ($i=0; $i<count($a); $i++) { echo (($i+1) * $o). " | "; $cd .= csc($a[$i], ($i+1) * $r); } return $cd; } var_dump(crs($f)); var_dump($r); var_dump(rcs($f, abs($r)));
based on j3VJA
Output for 5.6.38 - 7.3.0rc3
5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | string(13) "xybyslrbzbxuo" int(5) 5 | Notice: Undefined variable: r in /in/dSQVR on line 39 10 | Notice: Undefined variable: r in /in/dSQVR on line 39 15 | Notice: Undefined variable: r in /in/dSQVR on line 39 20 | Notice: Undefined variable: r in /in/dSQVR on line 39 25 | Notice: Undefined variable: r in /in/dSQVR on line 39 30 | Notice: Undefined variable: r in /in/dSQVR on line 39 35 | Notice: Undefined variable: r in /in/dSQVR on line 39 40 | Notice: Undefined variable: r in /in/dSQVR on line 39 45 | Notice: Undefined variable: r in /in/dSQVR on line 39 50 | Notice: Undefined variable: r in /in/dSQVR on line 39 55 | Notice: Undefined variable: r in /in/dSQVR on line 39 60 | Notice: Undefined variable: r in /in/dSQVR on line 39 65 | Notice: Undefined variable: r in /in/dSQVR on line 39 string(13) "somethingdumb"