3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validatePrintf($format, $arguments) { if (preg_match_all("~%(?:(\d+)[$])?[-+]?(?:[ 0]|['].)?(?:[-]?\d+)?(?:[.]\d+)?[%bcdeEufFgGosxX]~", $format, $expected) > 0) { return (count((array) $arguments) >= intval(max($expected[1]))); } return false; } var_dump(validatePrintf('The %2$s contains %1$d monkeys'), array(5, 'tree'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P9RFU
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'validateprintf'
          2        SEND_VAL                                                 'The+%252%24s+contains+%251%24d+monkeys'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        SEND_VAL                                                 <array>
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function validateprintf:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P9RFU
function name:  validatePrintf
number of ops:  20
compiled vars:  !0 = $format, !1 = $arguments, !2 = $expected
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%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        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $3      
          7        IS_SMALLER                                               0, $3
          8      > JMPZ                                                     ~4, ->18
    6     9    >   CAST                                          7  ~5      !1
         10        COUNT                                            ~6      ~5
         11        INIT_FCALL                                               'max'
         12        FETCH_DIM_R                                      ~7      !2, 1
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        CAST                                          4  ~9      $8
         16        IS_SMALLER_OR_EQUAL                              ~10     ~9, ~6
         17      > RETURN                                                   ~10
    9    18    > > RETURN                                                   <false>
   10    19*     > RETURN                                                   null

End of function validateprintf

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.99 ms | 1398 KiB | 20 Q