3v4l.org

run code in 300+ PHP versions simultaneously
<?php $endpoint = array( "mac_address"=>"989096e255a1", "status" =>"Known", "attributes" => array( "Owner"=>"rogue@wpi.edu", "IPAM-Hostname"=>"dresden.wpi.edu", "IPAM-AdminState"=>"OK", "IPAM-NAS-IP-Address"=>"0", "IPAM-NAS-Port-ID"=>"1", "IPAM-RADIUS-VLAN"=>"0", "IPAM-TimeStamp"=>"2017-07-11 11:18:33 EDT", "Guest Role ID"=>"false", "MAC-Auth Expiry"=>"1", "Username"=>"", ), "Username"=>"", ); $endpointcreate = array_filter($endpoint, function($var) {return !(($var=='') || isnull($var));}); $endpointcreate["attributes"] = array_filter($endpointcreate["attributes"], function($var) {return !empty($var);}); print_r($endpointcreate);
Output for 7.3.24 - 7.3.33, 7.4.12 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function isnull() in /in/ETPrJ:21 Stack trace: #0 [internal function]: {closure}('989096e255a1') #1 /in/ETPrJ(21): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/ETPrJ on line 21
Process exited with code 255.

preferences:
109.94 ms | 402 KiB | 114 Q