3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['alpha'] = 'anal'; if(isset($_POST['alpha']) or isset($_POST['emoji'])) { $array_emoji = [ 'a' => '🅰️', 'b' => '🅱️', 'c' => '©', 'd' => '↩', 'e' => '📧', 'f' => '🚩', 'g' => '🌀', 'h' => '♓', 'i' => 'ℹ', 'j' => '🎷', 'k' => '🎋', 'l' => '👢', 'm' => 'Ⓜ', 'n' => '♑', 'o' => '🅾️', 'p' => '🅿️', 'q' => '♎', 'r' => '®', 's' => '⚡', 't' => '🌴', 'u' => '⛎', 'v' => '✔', 'w' => '〰', 'x' => '❌', 'y' => '✌', 'z' => 'Ⓩ', '0' => '0️⃣', '1' => '1️⃣', '2' => '2️⃣', '3' => '3️⃣', '4' => '4️⃣', '5' => '5️⃣', '6' => '6️⃣', '7' => '7️⃣', '8' => '8️⃣', '9' => '9️⃣', '!' => '❗', '?' => '❓', '$' => '💲', '+' => '➕', '-' => '➖', '/' => '➗', '<' => '◀', '>' => '▶', '*' => '*️⃣', ';' => '🕹', ':' => '🚦', '(' => '📈', ')' => '📉', '\'' => '💧', '"' => '💦', '.' => '⏺', ]; if(isset($_POST['emoji'])) { $aEmoji = array_keys($array_emoji); $eEmoji = array_values($array_emoji); $out = str_replace($aEmoji, $eEmoji, $_POST['textEmoji']); echo 'Emoji:' . PHP_EOL . $out; } if(isset($_POST['alpha'])) { $aEmoji = array_values($array_emoji); $eEmoji = array_keys($array_emoji); $out = str_replace($aEmoji, $eEmoji, $_POST['textEmoji']); echo 'Alfabeto:' . PHP_EOL . $out; } }
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined array key "textEmoji" in /in/Tem22 on line 78 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/Tem22 on line 78 Alfabeto:
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 Warning: Undefined array key "textEmoji" in /in/Tem22 on line 78 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/Tem22 on line 78 Alfabeto:
Output for 8.0.0 - 8.0.30
Warning: Undefined array key "textEmoji" in /in/Tem22 on line 78 Alfabeto:
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined index: textEmoji in /in/Tem22 on line 78 Alfabeto:
Output for 7.3.32 - 7.3.33
Alfabeto:

preferences:
205.02 ms | 401 KiB | 212 Q