3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($string) { $pad = 'abcde'; $encrypted_string = ""; for ($i = 0; $i < strlen($string); $i++) { $char = $string[$i]; if ($i < strlen($pad) && preg_match("/[a-z]/i", $char)) { $shift_char = $pad[$i]; $ord_shift = ctype_upper($shift_char) ? 65 : 97; $shift_amount = ord($shift_char) - $ord_shift; if ($shift_amount) { $ord_char = ord($char) + $shift_amount; while ($ord_char > $ord_shift + 26) { $ord_char -= 26; } $char = chr($ord_char); } } $encrypted_string .= $char; } return $encrypted_string; } echo encrypt('thiS is a test');
Output for git.master, git.master_jit, rfc.property-hooks
tikV is a test

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:
45.37 ms | 401 KiB | 8 Q