3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.56 ms | 1395 KiB | 19 Q