3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = "~%(?:(\d+)[$])?[-+]?(?:[ 0]|['].)?(?:[-]?\d+)?(?:[.]\d+)?[%bcdeEufFgGosxX]~"; $format = 'The %s contains %d monkeys'; $arguments = array(5, 'tree'); if (preg_match_all($regex, $format, $expected) > 0) { print_r(max($expected[1])); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/6HJ9O
function name:  (null)
number of ops:  18
compiled vars:  !0 = $regex, !1 = $format, !2 = $arguments, !3 = $expected
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7E%25%28%3F%3A%28%5Cd%2B%29%5B%24%5D%29%3F%5B-%2B%5D%3F%28%3F%3A%5B+0%5D%7C%5B%27%5D.%29%3F%28%3F%3A%5B-%5D%3F%5Cd%2B%29%3F%28%3F%3A%5B.%5D%5Cd%2B%29%3F%5B%25bcdeEufFgGosxX%5D%7E'
    4     1        ASSIGN                                                   !1, 'The+%25s+contains+%25d+monkeys'
    5     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !3
          7        DO_ICALL                                         $7      
          8        IS_SMALLER                                               0, $7
          9      > JMPZ                                                     ~8, ->17
    9    10    >   INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'max'
         12        FETCH_DIM_R                                      ~9      !3, 1
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                                 
   10    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.28 ms | 1395 KiB | 19 Q