3v4l.org

run code in 500+ PHP versions simultaneously
<?php $csv_arr = [ 0 => (object) ["item" => 'banana', "picture" => ''], 1 => (object) ["item" => 'apple', "picture" => 'asdkls.jpg'], 2 => (object) ["item" => 'orange', "picture" => 'sda.jpg,sf.jpg,ffd.jpg'], 3 => (object) ["item" => 'pineapple', "picture" => ''], 4 => (object) ["item" => 'apricot', "picture" => ''], ]; //print_r($csv_arr); $output = array_filter($csv_arr, function($v, $k) { return !empty($v->picture); }, ARRAY_FILTER_USE_BOTH); print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9DUqJ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $csv_arr, !1 = $output
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   CAST                                              8  ~2      <array>
          1        INIT_ARRAY                                           ~3      ~2, 0
          2        CAST                                              8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                    ~3      ~4, 1
          4        CAST                                              8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                    ~3      ~5, 2
          6        CAST                                              8  ~6      <array>
          7        ADD_ARRAY_ELEMENT                                    ~3      ~6, 3
          8        CAST                                              8  ~7      <array>
          9        ADD_ARRAY_ELEMENT                                    ~3      ~7, 4
    3    10        ASSIGN                                                       !0, ~3
   13    11        INIT_FCALL                                                   'array_filter'
         12        SEND_VAR                                                     !0
         13        DECLARE_LAMBDA_FUNCTION                              ~9      [0]
   15    14        SEND_VAL                                                     ~9
         15        SEND_VAL                                                     1
   13    16        DO_ICALL                                             $10     
         17        ASSIGN                                                       !1, $10
   17    18        INIT_FCALL                                                   'print_r'
         19        SEND_VAR                                                     !1
         20        DO_ICALL                                                     
         21      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9DUqJ
function name:  {closure:/in/9DUqJ:13}
number of ops:  6
compiled vars:  !0 = $v, !1 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   14     2        ISSET_ISEMPTY_PROP_OBJ                               ~2      !0, 'picture'
          3        BOOL_NOT                                             ~3      ~2
          4      > RETURN                                                       ~3
   15     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.35 ms | 1620 KiB | 15 Q