3v4l.org

run code in 300+ PHP versions simultaneously
<?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, $a) { $ar = str_split($f); $cd = ""; for ($i=0; $i<count($a); $i++) { echo (($i+1) * $a). " | "; $cd .= csc($ar[$i], ($i+1) * $r); } return $cd; } var_dump(crs($f)); var_dump($r); var_dump(rcs($f, abs($r)));
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | string(13) "xybyslrbzbxuo" int(5) Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in /in/j3VJA:37 Stack trace: #0 /in/j3VJA(46): rcs('somethingdumb', 5) #1 {main} thrown in /in/j3VJA on line 37
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 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | string(13) "xybyslrbzbxuo" int(5) Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in /in/j3VJA:37 Stack trace: #0 /in/j3VJA(46): rcs('somethingdumb', 5) #1 {main} thrown in /in/j3VJA on line 37
Process exited with code 255.
Output for 8.0.0 - 8.0.9
5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | string(13) "xybyslrbzbxuo" int(5) Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, int given in /in/j3VJA:37 Stack trace: #0 /in/j3VJA(46): rcs('somethingdumb', 5) #1 {main} thrown in /in/j3VJA on line 37
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | string(13) "xybyslrbzbxuo" int(5) Warning: count(): Parameter must be an array or an object that implements Countable in /in/j3VJA on line 37 5 | Notice: Undefined variable: r in /in/j3VJA on line 39 Warning: count(): Parameter must be an array or an object that implements Countable in /in/j3VJA on line 37 string(1) "s"
Output for 7.3.32 - 7.3.33
5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | string(13) "xybyslrbzbxuo" int(5) Warning: count(): Parameter must be an array or an object that implements Countable in /in/j3VJA on line 37 5 | Warning: count(): Parameter must be an array or an object that implements Countable in /in/j3VJA on line 37 string(1) "s"
Output for 5.6.38, 7.1.0 - 7.1.33
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/j3VJA on line 39 string(1) "s"

preferences:
202.8 ms | 402 KiB | 203 Q