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)); $cscan = (array_chunk($escan, 5)); class d_object { var $mac; function __construct ($payload) { if (is_array($payload)) $this->from_array($payload); $this->mac = $mac; } public function from_array($array) { foreach(get_object_vars($this) as $attrName => $attrValue) $this->{$attrName} = $array[$attrName]; } public function s_output () { print "{$this->$mac}"; } } $device = new d_object($cscan); $device->s_output(); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined array key "mac" in /in/pin3p on line 23 Warning: Undefined variable $mac in /in/pin3p on line 16 Warning: Undefined variable $mac in /in/pin3p on line 28 Warning: Undefined property: d_object::$ in /in/pin3p on line 28
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Notice: Undefined property: d_object::$ in /in/pin3p on line 28
Output for 7.3.32 - 7.3.33
Output for 7.0.0 - 7.0.20
Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Fatal error: Uncaught Error: Cannot access empty property in /in/pin3p:28 Stack trace: #0 /in/pin3p(33): d_object->s_output() #1 {main} thrown in /in/pin3p on line 28
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Fatal error: Cannot access empty property in /in/pin3p on line 28
Process exited with code 255.
Output for 5.1.3 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Fatal error: Cannot access empty property in /in/pin3p on line 28
Process exited with code 255.
Output for 5.0.5, 5.1.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/pin3p on line 10 Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Fatal error: Cannot access empty property in /in/pin3p on line 28
Process exited with code 255.
Output for 5.0.4
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/pin3p on line 10 Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Notice: Undefined property: d_object::$ in /in/pin3p on line 28
Output for 5.0.0 - 5.0.3
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/pin3p on line 10 Notice: Undefined index: mac in /in/pin3p on line 23 Notice: Undefined variable: mac in /in/pin3p on line 16 Notice: Undefined variable: mac in /in/pin3p on line 28 Notice: Undefined property: d_object::$ in /in/pin3p on line 28
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/pin3p on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/pin3p on line 20
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/pin3p on line 20
Process exited with code 255.

preferences:
263.7 ms | 401 KiB | 350 Q