3v4l.org

run code in 300+ PHP versions simultaneously
<?php function name($string) { $find=array("1","2","3","4","5","6","7","8","9","10","11","12"); $replace=array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"); return $replace[array_search($string, $find)]; } echo name("12");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XEQUT
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'name'
          1        SEND_VAL                                                 '12'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XEQUT
function name:  name
number of ops:  10
compiled vars:  !0 = $string, !1 = $find, !2 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'array_search'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        FETCH_DIM_R                                      ~6      !2, $5
          8      > RETURN                                                   ~6
    6     9*     > RETURN                                                   null

End of function name

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
302.44 ms | 1011 KiB | 15 Q