3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo '<form action="emoji.php" method="POST">'; echo '<p>Input text: <input type="text" name="textEmoji" value="" style="width:100%;" /></p>'; echo '<p><button type="submit" name="emoji">Emoji</button>'; echo '<button type="submit" name="alpha">Alpha</button></p>'; $_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 git.master, git.master_jit, rfc.property-hooks
<form action="emoji.php" method="POST"><p>Input text: <input type="text" name="textEmoji" value="" style="width:100%;" /></p><p><button type="submit" name="emoji">Emoji</button><button type="submit" name="alpha">Alpha</button></p> Warning: Undefined array key "textEmoji" in /in/jPrsg on line 83 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/jPrsg on line 83 Alfabeto:

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:
68.3 ms | 402 KiB | 8 Q