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 { private $mac; var $enc; var $freq; var $ssid; var $channel; function __construct ($pl) { if (is_array($pl)) $this->from_array($pl); } public function from_array($cscan) { foreach(get_object_vars($this) as $attrName => $attrValue) $this->{$attrName} = $cscan[$attrName]; } public function s_output () { print "{$this->$mac}"; } } $device = new d_object($cscan); $device->s_output(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "mac" in /in/8ZKUa on line 26 Warning: Undefined array key "enc" in /in/8ZKUa on line 26 Warning: Undefined array key "freq" in /in/8ZKUa on line 26 Warning: Undefined array key "ssid" in /in/8ZKUa on line 26 Warning: Undefined array key "channel" in /in/8ZKUa on line 26 Warning: Undefined variable $mac in /in/8ZKUa on line 31 Warning: Undefined property: d_object::$ in /in/8ZKUa on line 31

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.1 ms | 402 KiB | 8 Q