3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.43 ms | 1395 KiB | 19 Q