3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "mac_address"=>"989096e255a1", "Username"=>"", "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"=>"", "morestuff" => array( "a" =>123, "b" =>"", "c" =>123, "d" =>123 ), ), ); $filtered = array_filter(array_map('array_filter',$arr)); print_r($filtered); $filtered = array_filter($arr, function($var) {return !empty($var);}); print_r($filtered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bmYJ2
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   27     1        INIT_FCALL                                               'array_filter'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'array_filter'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
   28     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   30    12        INIT_FCALL                                               'array_filter'
         13        SEND_VAR                                                 !0
         14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbmYJ2%3A30%240'
         15        SEND_VAL                                                 ~7
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !1, $8
   31    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbmYJ2%3A30%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bmYJ2
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FbmYJ2%3A30%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.51 ms | 1396 KiB | 19 Q