3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scan = "00:12:a9:54:f6:a7,Privacy,-52.00,3Com,6,30:91:8f:24:07:d0,RSN: Privacy,-85.00,CenturyLink3873,1,00:0c:e5:46:2d:74,ShortSlotTime,-92.00,WLAN,1,c0:3f:0e:57:87:e8,RSN: Privacy,-94.00,Megan-PC-Wireless,6,00:12:a9:54:f6:a7,ShortPreamble,-45.00,WLAN,7"; $escan = (explode(",",$scan)); class Util { function arrayToObject($array) { if (is_array($array)) { foreach ($array as $name => $value) { if (!empty($name)) { if(method_exists($object, 'set'.$name)){ $object->{'set'.$name}(Util::arrayToObject($value)); }else{ if(($strict)){ if(property_exists($class, $name)){ $object->$name = Util::arrayToObject($value); } }else{ $object->$name = Util::arrayToObject($value); } } } } return $object; } else { return FALSE; } } } $device = Util::arrayToObject($escan); var_dump($device); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Non-static method Util::arrayToObject() cannot be called statically in /in/WbOYY:30 Stack trace: #0 {main} thrown in /in/WbOYY on line 30
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Non-static method Util::arrayToObject() cannot be called statically in /in/WbOYY:30 Stack trace: #0 {main} thrown in /in/WbOYY on line 30
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 30 Notice: Undefined variable: object in /in/WbOYY on line 10 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Warning: Creating default object from empty value in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Deprecated: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 object(stdClass)#1 (24) { ["1"]=> bool(false) ["2"]=> bool(false) ["3"]=> bool(false) ["4"]=> bool(false) ["5"]=> bool(false) ["6"]=> bool(false) ["7"]=> bool(false) ["8"]=> bool(false) ["9"]=> bool(false) ["10"]=> bool(false) ["11"]=> bool(false) ["12"]=> bool(false) ["13"]=> bool(false) ["14"]=> bool(false) ["15"]=> bool(false) ["16"]=> bool(false) ["17"]=> bool(false) ["18"]=> bool(false) ["19"]=> bool(false) ["20"]=> bool(false) ["21"]=> bool(false) ["22"]=> bool(false) ["23"]=> bool(false) ["24"]=> bool(false) }
Output for 7.3.32 - 7.3.33
Warning: Creating default object from empty value in /in/WbOYY on line 18 object(stdClass)#1 (24) { ["1"]=> bool(false) ["2"]=> bool(false) ["3"]=> bool(false) ["4"]=> bool(false) ["5"]=> bool(false) ["6"]=> bool(false) ["7"]=> bool(false) ["8"]=> bool(false) ["9"]=> bool(false) ["10"]=> bool(false) ["11"]=> bool(false) ["12"]=> bool(false) ["13"]=> bool(false) ["14"]=> bool(false) ["15"]=> bool(false) ["16"]=> bool(false) ["17"]=> bool(false) ["18"]=> bool(false) ["19"]=> bool(false) ["20"]=> bool(false) ["21"]=> bool(false) ["22"]=> bool(false) ["23"]=> bool(false) ["24"]=> bool(false) }
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 30 Notice: Undefined variable: object in /in/WbOYY on line 10 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Warning: Creating default object from empty value in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 Notice: Undefined variable: strict in /in/WbOYY on line 13 Strict Standards: Non-static method Util::arrayToObject() should not be called statically in /in/WbOYY on line 18 object(stdClass)#1 (24) { ["1"]=> bool(false) ["2"]=> bool(false) ["3"]=> bool(false) ["4"]=> bool(false) ["5"]=> bool(false) ["6"]=> bool(false) ["7"]=> bool(false) ["8"]=> bool(false) ["9"]=> bool(false) ["10"]=> bool(false) ["11"]=> bool(false) ["12"]=> bool(false) ["13"]=> bool(false) ["14"]=> bool(false) ["15"]=> bool(false) ["16"]=> bool(false) ["17"]=> bool(false) ["18"]=> bool(false) ["19"]=> bool(false) ["20"]=> bool(false) ["21"]=> bool(false) ["22"]=> bool(false) ["23"]=> bool(false) ["24"]=> bool(false) }

preferences:
214.98 ms | 413 KiB | 270 Q