3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = 'there is no spoon'; $matches = []; preg_match('~(spoon|fiddle)~',$s,$matches); var_dump($matches); //seems that yes, we can reuse $matches. preg_match('~(blah)~',$s,$matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fXp6L
function name:  (null)
number of ops:  19
compiled vars:  !0 = $s, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'there+is+no+spoon'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%7E%28spoon%7Cfiddle%29%7E'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%7E%28blah%29%7E'
         12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !1
         14        DO_ICALL                                                 
   11    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.1 ms | 1394 KiB | 17 Q