3v4l.org

run code in 500+ PHP versions simultaneously
<?php $bom = "\xFF\xFE"; $str = $bom.$bom.'john'; $removeStr = substr($str, strlen($bom)); $removeStrMb = mb_substr($str, mb_strlen($bom)); var_dump( $removeStr === $bom.'john', $removeStrMb === $bom.'john', );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NnkoU
function name:  (null)
number of ops:  24
compiled vars:  !0 = $bom, !1 = $str, !2 = $removeStr, !3 = $removeStrMb
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%FF%FE'
    4     1        CONCAT                                               ~5      !0, !0
          2        CONCAT                                               ~6      ~5, 'john'
          3        ASSIGN                                                       !1, ~6
    5     4        STRLEN                                               ~8      !0
          5        FRAMELESS_ICALL_2                substr              ~9      !1, ~8
          6        ASSIGN                                                       !2, ~9
    6     7        INIT_FCALL                                                   'mb_substr'
          8        SEND_VAR                                                     !1
          9        INIT_FCALL                                                   'mb_strlen'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                             $11     
         12        SEND_VAR                                                     $11
         13        DO_ICALL                                             $12     
         14        ASSIGN                                                       !3, $12
    8    15        INIT_FCALL                                                   'var_dump'
    9    16        CONCAT                                               ~14     !0, 'john'
         17        IS_IDENTICAL                                         ~15     !2, ~14
         18        SEND_VAL                                                     ~15
   10    19        CONCAT                                               ~16     !0, 'john'
         20        IS_IDENTICAL                                         ~17     !3, ~16
         21        SEND_VAL                                                     ~17
    8    22        DO_ICALL                                                     
   11    23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
118.65 ms | 479 KiB | 10 Q