3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeBOM($str="") { if(substr($str, 0, 3) == pack("CCC", 0xef, 0xbb, 0xbf)) { $str = substr($str, 3); } return $str; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tJdgh
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   1

Function removebom:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/tJdgh
function name:  removeBOM
number of ops:  21
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      ''
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $1      
          6        INIT_FCALL                                               'pack'
          7        SEND_VAL                                                 'CCC'
          8        SEND_VAL                                                 239
          9        SEND_VAL                                                 187
         10        SEND_VAL                                                 191
         11        DO_ICALL                                         $2      
         12        IS_EQUAL                                                 $1, $2
         13      > JMPZ                                                     ~3, ->19
    6    14    >   INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 3
         17        DO_ICALL                                         $4      
         18        ASSIGN                                                   !0, $4
    8    19    > > RETURN                                                   !0
    9    20*     > RETURN                                                   null

End of function removebom

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.01 ms | 1387 KiB | 17 Q