3v4l.org

run code in 500+ PHP versions simultaneously
<?php $subject = '1234567890'; preg_replace_callback( '#^([a-z]+)$|^([0-9]+)$#', function ($m) { var_dump($m); return null === $m[1] ? '1' : 'a'; }, $subject, 1, $count, PREG_UNMATCHED_AS_NULL );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JdUaY
function name:  (null)
number of ops:  11
compiled vars:  !0 = $subject, !1 = $count
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1234567890'
    5     1        INIT_FCALL                                                   'preg_replace_callback'
    6     2        SEND_VAL                                                     '%23%5E%28%5Ba-z%5D%2B%29%24%7C%5E%28%5B0-9%5D%2B%29%24%23'
    7     3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   10     4        SEND_VAL                                                     ~3
   11     5        SEND_VAR                                                     !0
   12     6        SEND_VAL                                                     1
   13     7        SEND_REF                                                     !1
   14     8        SEND_VAL                                                     512
    5     9        DO_ICALL                                                     
   15    10      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JdUaY
function name:  {closure:/in/JdUaY:7}
number of ops:  12
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    8     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
    9     4        FETCH_DIM_R                                          ~2      !0, 1
          5        TYPE_CHECK                                        2          ~2
          6      > JMPZ                                                         ~3, ->9
          7    >   QM_ASSIGN                                            ~4      '1'
          8      > JMP                                                          ->10
          9    >   QM_ASSIGN                                            ~4      'a'
         10    > > RETURN                                                       ~4
   10    11*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.88 ms | 1930 KiB | 15 Q