3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getIndex($name) { $algorithm = null; if ($pos = stripos($name, '_USING_')) { $algorithm = substr($name, $pos + 7); } return $algorithm; } echo getIndex('textsearch_index_USING_GIST');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/njl1k
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getindex'
          1        SEND_VAL                                                 'textsearch_index_USING_GIST'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function getindex:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/njl1k
function name:  getIndex
number of ops:  16
compiled vars:  !0 = $name, !1 = $algorithm, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, null
    5     2        INIT_FCALL                                               'stripos'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '_USING_'
          5        DO_ICALL                                         $4      
          6        ASSIGN                                           ~5      !2, $4
          7      > JMPZ                                                     ~5, ->14
    6     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        ADD                                              ~6      !2, 7
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
    8    14    > > RETURN                                                   !1
    9    15*     > RETURN                                                   null

End of function getindex

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.56 ms | 1398 KiB | 18 Q