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 $expected; 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/XatB2
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'validateprintf'
          2        SEND_VAL                                                 'The+%252%24s+contains+%251%24d+monkeys'
          3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          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 = 19
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XatB2
function name:  validatePrintf
number of ops:  21
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, ->19
    6     9    > > RETURN                                                   !2
    7    10*       CAST                                          7  ~5      !1
         11*       COUNT                                            ~6      ~5
         12*       INIT_FCALL                                               'max'
         13*       FETCH_DIM_R                                      ~7      !2, 1
         14*       SEND_VAL                                                 ~7
         15*       DO_ICALL                                         $8      
         16*       CAST                                          4  ~9      $8
         17*       IS_SMALLER_OR_EQUAL                              ~10     ~9, ~6
         18*       RETURN                                                   ~10
   10    19    > > RETURN                                                   <false>
   11    20*     > RETURN                                                   null

End of function validateprintf

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.21 ms | 1399 KiB | 20 Q