3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variable_name = 'field_bundle_settings_my_type__my_field__name'; $name = str_replace('field_bundle_settings_', '', $variable_name); $entity_type = substr($name, 0, strpos($name, '__')); $bundle = substr($name, strpos($name, '__') + 2); print $entity_type . "\n"; print $bundle;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbmDZ
function name:  (null)
number of ops:  31
compiled vars:  !0 = $variable_name, !1 = $name, !2 = $entity_type, !3 = $bundle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'field_bundle_settings_my_type__my_field__name'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 'field_bundle_settings_'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    5     7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 0
         10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 '__'
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !2, $8
    6    17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !1
         19        INIT_FCALL                                               'strpos'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 '__'
         22        DO_ICALL                                         $10     
         23        ADD                                              ~11     $10, 2
         24        SEND_VAL                                                 ~11
         25        DO_ICALL                                         $12     
         26        ASSIGN                                                   !3, $12
    7    27        CONCAT                                           ~14     !2, '%0A'
         28        ECHO                                                     ~14
    8    29        ECHO                                                     !3
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.31 ms | 1395 KiB | 19 Q