3v4l.org

run code in 300+ PHP versions simultaneously
<?php $utf8string = 'жжhello123'; $var = 'hello123'; $pos = strpos($utf8string, $var); if ($pos!==false) { echo substr($utf8string, 0, $pos); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/657qr
function name:  (null)
number of ops:  16
compiled vars:  !0 = $utf8string, !1 = $var, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%D0%B6%D0%B6hello123'
    5     1        ASSIGN                                                   !1, 'hello123'
    6     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    7     7        TYPE_CHECK                                  1018          !2
          8      > JMPZ                                                     ~7, ->15
    8     9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 0
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14        ECHO                                                     $8
    9    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.9 ms | 1386 KiB | 17 Q