3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "({max_w} * {max_h} * {key|value}) / {key_1|value}"; $pattern = "/{\K[^{}|]*\|[^{}|]*(?=})/"; preg_match_all($pattern, $str, $matches); print_r($matches[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cirfY
function name:  (null)
number of ops:  12
compiled vars:  !0 = $str, !1 = $pattern, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%28%7Bmax_w%7D+%2A+%7Bmax_h%7D+%2A+%7Bkey%7Cvalue%7D%29+%2F+%7Bkey_1%7Cvalue%7D'
    4     1        ASSIGN                                                       !1, '%2F%7B%5CK%5B%5E%7B%7D%7C%5D%2A%5C%7C%5B%5E%7B%7D%7C%5D%2A%28%3F%3D%7D%29%2F'
    5     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !1
          4        SEND_VAR                                                     !0
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
    6     7        INIT_FCALL                                                   'print_r'
          8        FETCH_DIM_R                                          ~6      !2, 0
          9        SEND_VAL                                                     ~6
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
145.1 ms | 1971 KiB | 15 Q