3v4l.org

run code in 500+ PHP versions simultaneously
<?php const CHAR_TO_MORSE = [ "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" => "-----", "1" => ".----", "2" => "..---", "3" => "...--", "4" => "....-", "5" => ".....", "6" => "-....", "7" => "--...", "8" => "---..", "9" => "----.", "." => ".-.-.-", "," => "--..--", "?" => "..--..", "/" => "-..-.", ]; $string = "d o g"; echo strtr($string, CHAR_TO_MORSE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/49K0a
function name:  (null)
number of ops:  6
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                                'CHAR_TO_MORSE', <array>
   46     1        ASSIGN                                                       !0, 'd+o+g'
   47     2        FETCH_CONSTANT                                       ~2      'CHAR_TO_MORSE'
          3        FRAMELESS_ICALL_2                strtr               ~3      !0, ~2
          4        ECHO                                                         ~3
          5      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.18 ms | 1849 KiB | 15 Q