3v4l.org

run code in 300+ PHP versions simultaneously
<?php // http://pastebin.ca/2531805 $content_array = array ( 0 => array ( 0 => '[CONTENT HEADER]', 1 => '[LINK TEXT]', 2 => '[CONTENT IMAGE URL]', 3 => '[CONTENT TEXT]', 4 => '[ALTERNATE SUBJECT]', 5 => '[COUPON IMAGE URL]', 6 => '[COUPON HEADER]', 7 => '[COUPON CONTENT]', 8 => '[COUPON LINK]', 9 => '[recordid]', 10 => '[COUPON LINK TEXT]', ), ); $excluded_content_pieces = array( '[recordid]' ); foreach($content_array as $content_piece) { // Filter out the excluded pieces $content_piece = array_filter( $content_piece, function($a) use ($excluded_content_pieces) { return !in_array($a, $excluded_content_pieces); } ); } // Clean up $content_piece unset($content_piece); var_dump($content_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/JSa12
function name:  (null)
number of ops:  18
compiled vars:  !0 = $content_array, !1 = $excluded_content_pieces, !2 = $content_piece
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $5      !0, ->12
          3    > > FE_FETCH_R                                               $5, !2, ->12
   12     4    >   INIT_FCALL                                               'array_filter'
   13     5        SEND_VAR                                                 !2
   14     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJSa12%3A14%240'
          7        BIND_LEXICAL                                             ~6, !1
   16     8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
   12    10        ASSIGN                                                   !2, $7
   10    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   21    13        UNSET_CV                                                 !2
   23    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJSa12%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JSa12
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $excluded_content_pieces
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        BOOL_NOT                                         ~3      $2
          7      > RETURN                                                   ~3
   16     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJSa12%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.34 ms | 1396 KiB | 19 Q