3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'abed'; function convert_to_int($string) {; $characters = array_merge([' '], range('a', 'z')); return str_replace(array_values($characters), array_keys($characters), $string); } echo convert_to_int('abed'); echo "\n"; echo convert_to_int('abed 5');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHZap
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'abed'
   10     1        INIT_FCALL                                                   'convert_to_int'
          2        SEND_VAL                                                     'abed'
          3        DO_FCALL                                          0  $2      
          4        ECHO                                                         $2
   11     5        ECHO                                                         '%0A'
   12     6        INIT_FCALL                                                   'convert_to_int'
          7        SEND_VAL                                                     'abed+5'
          8        DO_FCALL                                          0  $3      
          9        ECHO                                                         $3
         10      > RETURN                                                       1

Function convert_to_int:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHZap
function name:  convert_to_int
number of ops:  20
compiled vars:  !0 = $string, !1 = $characters
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        INIT_FCALL                                                   'array_merge'
          2        SEND_VAL                                                     <array>
          3        INIT_FCALL                                                   'range'
          4        SEND_VAL                                                     'a'
          5        SEND_VAL                                                     'z'
          6        DO_ICALL                                             $2      
          7        SEND_VAR                                                     $2
          8        DO_ICALL                                             $3      
          9        ASSIGN                                                       !1, $3
    7    10        INIT_FCALL                                                   'array_values'
         11        SEND_VAR                                                     !1
         12        DO_ICALL                                             $5      
         13        INIT_FCALL                                                   'array_keys'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                             $6      
         16        FRAMELESS_ICALL_3                str_replace         ~7      $5, $6
         17        OP_DATA                                                      !0
         18      > RETURN                                                       ~7
    8    19*     > RETURN                                                       null

End of function convert_to_int

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.17 ms | 2073 KiB | 19 Q