3v4l.org

run code in 300+ PHP versions simultaneously
<?php $utf8string = 'ASCIIユーティーエッフ8hello123等々'; $var = 'hello123'; $pos = strpos($utf8string, $var); echo $pos; if ($pos!==false) { echo substr($utf8string, 0, $pos); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/JEKlS
function name:  (null)
number of ops:  17
compiled vars:  !0 = $utf8string, !1 = $var, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ASCII%E3%83%A6%E3%83%BC%E3%83%86%E3%82%A3%E3%83%BC%E3%82%A8%E3%83%83%E3%83%95%EF%BC%98hello123%E7%AD%89%E3%80%85'
    5     1        ASSIGN                                                   !1, 'hello123'
    7     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    8     7        ECHO                                                     !2
    9     8        TYPE_CHECK                                  1018          !2
          9      > JMPZ                                                     ~7, ->16
   10    10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $8      
         15        ECHO                                                     $8
   11    16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.38 ms | 1386 KiB | 17 Q