3v4l.org

run code in 300+ 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:  9
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        INIT_FCALL                                               'strtr'
          3        SEND_VAR                                                 !0
          4        FETCH_CONSTANT                                   ~2      'CHAR_TO_MORSE'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
          8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.82 ms | 1003 KiB | 14 Q