3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyMorse { private array $plainTextsByMorseCode = [ '.-' => 'A', '....' => 'H', '.-..' => 'L', '-.' => 'N', '---' => 'O', '.--.' => 'P', '...' => 'S', '-' => 'T', '..-' => 'U', '-.--' => 'Y', ]; public function decode(string $morseCode): string { return strtr($morseCode, $this->plainTextsByMorseCode + [' ' => ' ', ' ' => '']); } } $obj = new MyMorse(); var_export( $obj->decode('-.-- --- ..- ... .... .- .-.. .-.. -. --- - .--. .- ... ...') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vCaMU
function name:  (null)
number of ops:  10
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   NEW                                                  $1      'MyMorse'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   25     3        INIT_FCALL                                                   'var_export'
   26     4        INIT_METHOD_CALL                                             !0, 'decode'
          5        SEND_VAL_EX                                                  '-.--+---+..-+++...+....+.-+.-..+.-..+++-.+---+-+++.--.+.-+...+...'
          6        DO_FCALL                                          0  $4      
          7        SEND_VAR                                                     $4
   25     8        DO_ICALL                                                     
   27     9      > RETURN                                                       1

Class MyMorse:
Function decode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vCaMU
function name:  decode
number of ops:  8
compiled vars:  !0 = $morseCode
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   20     1        FETCH_OBJ_R                                          ~1      'plainTextsByMorseCode'
          2        ADD                                                  ~2      ~1, <array>
          3        FRAMELESS_ICALL_2                strtr               ~3      !0, ~2
          4        VERIFY_RETURN_TYPE                                           ~3
          5      > RETURN                                                       ~3
   21     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function decode

End of class MyMorse.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
186.41 ms | 1585 KiB | 14 Q