3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); function doFoobarNull(string $s): void { if (preg_match('/(foo)?(bar)?(baz)?/', $s, $matches, PREG_OFFSET_CAPTURE)) { var_dump($matches); } } doFoobarNull("baz");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yra1j
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'dofoobarnull'
          1        SEND_VAL                                                 'baz'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function dofoobarnull:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Yra1j
function name:  doFoobarNull
number of ops:  12
compiled vars:  !0 = $s, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28foo%29%3F%28bar%29%3F%28baz%29%3F%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 256
          6        DO_ICALL                                         $2      
          7      > JMPZ                                                     $2, ->11
    6     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
    8    11    > > RETURN                                                   null

End of function dofoobarnull

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.63 ms | 1000 KiB | 16 Q