3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = '${first_name}, ${last_name}, ${create_date:(Y-m-d)}, ${submit_date:(Y-m-d)}'; var_export(preg_match_all('~\$\{([^:}]+)(?::([^}]+))?~', $string, $out, PREG_SET_ORDER) ? $out : 'fail');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2vTTY
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $out
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%24%7Bfirst_name%7D%2C+%24%7Blast_name%7D%2C+%24%7Bcreate_date%3A%28Y-m-d%29%7D%2C+%24%7Bsubmit_date%3A%28Y-m-d%29%7D'
    3     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAL                                                     '%7E%5C%24%5C%7B%28%5B%5E%3A%7D%5D%2B%29%28%3F%3A%3A%28%5B%5E%7D%5D%2B%29%29%3F%7E'
          4        SEND_VAR                                                     !0
          5        SEND_REF                                                     !1
          6        SEND_VAL                                                     2
          7        DO_ICALL                                             $3      
          8      > JMPZ                                                         $3, ->11
          9    >   QM_ASSIGN                                            ~4      !1
         10      > JMP                                                          ->12
         11    >   QM_ASSIGN                                            ~4      'fail'
         12    >   SEND_VAL                                                     ~4
         13        DO_ICALL                                                     
         14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.43 ms | 2087 KiB | 15 Q