3v4l.org

run code in 300+ PHP versions simultaneously
<?php $e['invalid']['key'][] = 'a123'; $e['invalid']['key'][] = 'a456'; $e['invalid']['color'][] = 'red'; $e['missing']['key'][] = 'b72'; $e['missing']['color'][] = 'blue'; $e['missing']['color'][] = 'green'; define("ERROR_LOOKUP", [ 'invalid' => '%s is not a valid %s', 'missing' => '%s is a required %s - other functions have dependencies on it', ]); define("ERROR_TYPES", array_keys(ERROR_LOOKUP)); $errors = []; foreach (array_diff_key($e, ERROR_TYPES) as $type => $subtypes) { foreach ($subtypes as $subtype => $entry) { foreach ($entry as $string) { $errors[] = sprintf(ERROR_LOOKUP[$type], $subtype, $string); } } } echo implode("\n", $errors);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 64
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 64
Branch analysis from position: 44
2 jumps found. (Code = 77) Position 1 = 46, Position 2 = 62
Branch analysis from position: 46
2 jumps found. (Code = 78) Position 1 = 47, Position 2 = 62
Branch analysis from position: 47
2 jumps found. (Code = 77) Position 1 = 49, Position 2 = 60
Branch analysis from position: 49
2 jumps found. (Code = 78) Position 1 = 50, Position 2 = 60
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 60
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 62
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
filename:       /in/5a6hi
function name:  (null)
number of ops:  71
compiled vars:  !0 = $e, !1 = $errors, !2 = $subtypes, !3 = $type, !4 = $entry, !5 = $subtype, !6 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_DIM_W                                      $7      !0, 'invalid'
          1        FETCH_DIM_W                                      $8      $7, 'key'
          2        ASSIGN_DIM                                               $8
          3        OP_DATA                                                  'a123'
    3     4        FETCH_DIM_W                                      $10     !0, 'invalid'
          5        FETCH_DIM_W                                      $11     $10, 'key'
          6        ASSIGN_DIM                                               $11
          7        OP_DATA                                                  'a456'
    4     8        FETCH_DIM_W                                      $13     !0, 'invalid'
          9        FETCH_DIM_W                                      $14     $13, 'color'
         10        ASSIGN_DIM                                               $14
         11        OP_DATA                                                  'red'
    5    12        FETCH_DIM_W                                      $16     !0, 'missing'
         13        FETCH_DIM_W                                      $17     $16, 'key'
         14        ASSIGN_DIM                                               $17
         15        OP_DATA                                                  'b72'
    6    16        FETCH_DIM_W                                      $19     !0, 'missing'
         17        FETCH_DIM_W                                      $20     $19, 'color'
         18        ASSIGN_DIM                                               $20
         19        OP_DATA                                                  'blue'
    7    20        FETCH_DIM_W                                      $22     !0, 'missing'
         21        FETCH_DIM_W                                      $23     $22, 'color'
         22        ASSIGN_DIM                                               $23
         23        OP_DATA                                                  'green'
    9    24        INIT_FCALL                                               'define'
         25        SEND_VAL                                                 'ERROR_LOOKUP'
   10    26        SEND_VAL                                                 <array>
    9    27        DO_ICALL                                                 
   13    28        INIT_FCALL                                               'define'
         29        SEND_VAL                                                 'ERROR_TYPES'
         30        INIT_FCALL                                               'array_keys'
         31        FETCH_CONSTANT                                   ~26     'ERROR_LOOKUP'
         32        SEND_VAL                                                 ~26
         33        DO_ICALL                                         $27     
         34        SEND_VAR                                                 $27
         35        DO_ICALL                                                 
   15    36        ASSIGN                                                   !1, <array>
   16    37        INIT_FCALL                                               'array_diff_key'
         38        SEND_VAR                                                 !0
         39        FETCH_CONSTANT                                   ~30     'ERROR_TYPES'
         40        SEND_VAL                                                 ~30
         41        DO_ICALL                                         $31     
         42      > FE_RESET_R                                       $32     $31, ->64
         43    > > FE_FETCH_R                                       ~33     $32, !2, ->64
         44    >   ASSIGN                                                   !3, ~33
   17    45      > FE_RESET_R                                       $35     !2, ->62
         46    > > FE_FETCH_R                                       ~36     $35, !4, ->62
         47    >   ASSIGN                                                   !5, ~36
   18    48      > FE_RESET_R                                       $38     !4, ->60
         49    > > FE_FETCH_R                                               $38, !6, ->60
   19    50    >   INIT_FCALL                                               'sprintf'
         51        FETCH_CONSTANT                                   ~40     'ERROR_LOOKUP'
         52        FETCH_DIM_R                                      ~41     ~40, !3
         53        SEND_VAL                                                 ~41
         54        SEND_VAR                                                 !5
         55        SEND_VAR                                                 !6
         56        DO_ICALL                                         $42     
         57        ASSIGN_DIM                                               !1
         58        OP_DATA                                                  $42
   18    59      > JMP                                                      ->49
         60    >   FE_FREE                                                  $38
   17    61      > JMP                                                      ->46
         62    >   FE_FREE                                                  $35
   16    63      > JMP                                                      ->43
         64    >   FE_FREE                                                  $32
   23    65        INIT_FCALL                                               'implode'
         66        SEND_VAL                                                 '%0A'
         67        SEND_VAR                                                 !1
         68        DO_ICALL                                         $43     
         69        ECHO                                                     $43
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.26 ms | 1009 KiB | 18 Q