3v4l.org

run code in 300+ 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:  23
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                                               'str_replace'
         11        INIT_FCALL                                               'array_values'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        INIT_FCALL                                               'array_keys'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $7      
         21      > RETURN                                                   $7
    8    22*     > RETURN                                                   null

End of function convert_to_int

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
213.42 ms | 1399 KiB | 25 Q