3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(-1); ini_set('display_errors', 'On'); $array = [ 'Alex' => [ [ ['event' => 'eventName1'],['event' => 'eventName2'] ], [ ['event' => 'eventName3'],['event' => 'eventName4'] ], [ ['event' => 'eventName5'],['event' => 'eventName6'] ], [ ['event' => 'eventName7'],['event' => 'eventName8'] ], [], [], [] ], 'christoper'=>[ [],[],[],[],[],[],[] ] ]; $output = array_filter($array, function (array $studentDays) { foreach ($studentDays as $day) { if (! empty($day)) { return true; } } return false; }); print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AkshS
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    5     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 'On'
          6        DO_ICALL                                                 
    7     7        ASSIGN                                                   !0, <array>
   31     8        INIT_FCALL                                               'array_filter'
          9        SEND_VAR                                                 !0
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAkshS%3A31%240'
   39    11        SEND_VAL                                                 ~5
         12        DO_ICALL                                         $6      
   31    13        ASSIGN                                                   !1, $6
   41    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAkshS%3A31%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/AkshS
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $studentDays, !1 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   32     1      > FE_RESET_R                                       $2      !0, ->9
          2    > > FE_FETCH_R                                               $2, !1, ->9
   33     3    >   ISSET_ISEMPTY_CV                                 ~3      !1
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->8
   34     6    >   FE_FREE                                                  $2
          7      > RETURN                                                   <true>
   32     8    > > JMP                                                      ->2
          9    >   FE_FREE                                                  $2
   38    10      > RETURN                                                   <false>
   39    11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAkshS%3A31%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.23 ms | 1401 KiB | 21 Q