3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categories = array( array('name' => 'ImportOrders', 'keywords' => array('ImportOrders', 'CountriesArrayResponse')) ); $matches = array(); $types = array('Keks', 'Import'); foreach($categories as $cat) { foreach($cat['keywords'] as $keyword) { $array_filter = function($var) use ($keyword) { return preg_match("/\b$keyword\b/i", $var); }; $matches[$cat['name']] = array_push(array_filter($types, $array_filter)); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 22
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/Ze45K
function name:  (null)
number of ops:  26
compiled vars:  !0 = $categories, !1 = $matches, !2 = $types, !3 = $cat, !4 = $keyword, !5 = $array_filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, <array>
    8     3      > FE_RESET_R                                       $9      !0, ->24
          4    > > FE_FETCH_R                                               $9, !3, ->24
    9     5    >   FETCH_DIM_R                                      ~10     !3, 'keywords'
          6      > FE_RESET_R                                       $11     ~10, ->22
          7    > > FE_FETCH_R                                               $11, !4, ->22
   10     8    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZe45K%3A10%240'
          9        BIND_LEXICAL                                             ~12, !4
         10        ASSIGN                                                   !5, ~12
   11    11        FETCH_DIM_R                                      ~14     !3, 'name'
         12        INIT_FCALL                                               'array_push'
         13        INIT_FCALL                                               'array_filter'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !5
         16        DO_ICALL                                         $16     
         17        SEND_VAR_NO_REF                               0          $16
         18        DO_ICALL                                         $17     
         19        ASSIGN_DIM                                               !1, ~14
         20        OP_DATA                                                  $17
    9    21      > JMP                                                      ->7
         22    >   FE_FREE                                                  $11
    8    23      > JMP                                                      ->4
         24    >   FE_FREE                                                  $9
   13    25      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZe45K%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ze45K
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $var, !1 = $keyword
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'preg_match'
          3        ROPE_INIT                                     3  ~3      '%2F%5Cb'
          4        ROPE_ADD                                      1  ~3      ~3, !1
          5        ROPE_END                                      2  ~2      ~3, '%5Cb%2Fi'
          6        SEND_VAL                                                 ~2
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9      > RETURN                                                   $5
         10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZe45K%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.45 ms | 1392 KiB | 19 Q