3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "mac_address"=>"989096e255a1", "status" =>"Known", "attributes" => array( "Owner"=>"rogue@wpi.edu", "IPAM-Hostname"=>"dresden.wpi.edu", "IPAM-AdminState"=>"OK", "IPAM-NAS-IP-Address"=>"", "IPAM-NAS-Port-ID"=>"", "IPAM-RADIUS-VLAN"=>"", "IPAM-TimeStamp"=>"2017-07-11 11:18:33 EDT", "Guest Role ID"=>"", "MAC-Auth Expiry"=>"", "Username"=>"", ), "Username"=>"", ); $filtered = array_filter($arr, function($var) {if(is_array($var)){return array_map('array_filter', $var);}else{return !empty($var);}} ); print_r($filtered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5r80U
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr, !1 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F5r80U%3A21%240'
   22     4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
   21     6        ASSIGN                                                   !1, $4
   25     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F5r80U%3A21%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5r80U
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->9
          3    >   INIT_FCALL                                               'array_map'
          4        SEND_VAL                                                 'array_filter'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
          8*       JMP                                                      ->12
          9    >   ISSET_ISEMPTY_CV                                 ~3      !0
         10        BOOL_NOT                                         ~4      ~3
         11      > RETURN                                                   ~4
         12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F5r80U%3A21%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.06 ms | 1395 KiB | 19 Q