3v4l.org

run code in 300+ PHP versions simultaneously
<?php $type = ''; $index = -1; $t = "audio/x-wav-chunk; index=10"; $_p = strpos($t, ';'); if ($_p !== false) $type = substr($t, 0, $_p); $_p = strpos($t, 'index='); if ($_p !== false) $index = (int)substr($t, $_p + 6); print_r($type); print_r($index);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 16
filename:       /in/Nu8mT
function name:  (null)
number of ops:  37
compiled vars:  !0 = $type, !1 = $index, !2 = $t, !3 = $_p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    4     1        ASSIGN                                                   !1, -1
    5     2        ASSIGN                                                   !2, 'audio%2Fx-wav-chunk%3B+index%3D10'
    6     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !2
          5        SEND_VAL                                                 '%3B'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !3, $7
    7     8        TYPE_CHECK                                  1018          !3
          9      > JMPZ                                                     ~9, ->16
    8    10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !0, $10
    9    16    >   INIT_FCALL                                               'strpos'
         17        SEND_VAR                                                 !2
         18        SEND_VAL                                                 'index%3D'
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !3, $12
   10    21        TYPE_CHECK                                  1018          !3
         22      > JMPZ                                                     ~14, ->30
   11    23    >   INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !2
         25        ADD                                              ~15     !3, 6
         26        SEND_VAL                                                 ~15
         27        DO_ICALL                                         $16     
         28        CAST                                          4  ~17     $16
         29        ASSIGN                                                   !1, ~17
   12    30    >   INIT_FCALL                                               'print_r'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                                 
   13    33        INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.03 ms | 1396 KiB | 19 Q