3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a($pattern, $subject, &$matches = null) { return preg_match($patter, $subject, $matches); } $r = a('~[a|b]+~', 'aaaa', $matches); var_dump($r, $matches); $r = a('~[a|b]+~', 'aaaa'); var_dump($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rZZrc
function name:  (null)
number of ops:  19
compiled vars:  !0 = $r, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'a'
          1        SEND_VAL                                                 '%7E%5Ba%7Cb%5D%2B%7E'
          2        SEND_VAL                                                 'aaaa'
          3        SEND_REF                                                 !1
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   12    10        INIT_FCALL                                               'a'
         11        SEND_VAL                                                 '%7E%5Ba%7Cb%5D%2B%7E'
         12        SEND_VAL                                                 'aaaa'
         13        DO_FCALL                                      0  $5      
         14        ASSIGN                                                   !0, $5
   14    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rZZrc
function name:  a
number of ops:  10
compiled vars:  !0 = $pattern, !1 = $subject, !2 = $matches, !3 = $patter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
    5     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !3
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !2
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
    6     9*     > RETURN                                                   null

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1399 KiB | 19 Q