3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $config = array(); $config['dhcpd'] = array(); $config['dhcpd']['numberoptions'] = array(); $config['dhcpd']['numberoptions']['item'] = array(); $config['dhcpd']['numberoptions']['item'][0] = "Zero"; $config['dhcpd']['numberoptions']['item'][1] = "One"; $config['dhcpd']['numberoptions']['item'][2] = "Two"; $config['dhcpdv6'] = array(); $config['dhcpdv6']['numberoptions'] = array(); $config['dhcpdv6']['numberoptions']['item'] = array(); $config['dhcpdv6']['numberoptions']['item'][0] = "v6-Zero"; $config['dhcpdv6']['numberoptions']['item'][1] = "v6-One"; $config['dhcpdv6']['numberoptions']['item'][2] = "v6-Two"; if (is_array($config['dhcpd'])) { foreach ($config['dhcpd'] as &$dhcpd) { if (!is_array($dhcpd['numberoptions']['item'])) { continue; } foreach ($dhcpd['numberoptions']['item'] as &$item) { $item['value'] = base64_encode($item['value']); } } } if (is_array($config['dhcpdv6'])) { foreach ($config['dhcpdv6'] as &$dhcpdv6) { if (!is_array($dhcpdv6['numberoptions']['item'])) { continue; } foreach ($dhcpdv6['numberoptions']['item'] as &$item) { $item['value'] = base64_encode($item['value']); } } } } var_dump($config);
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '}', expecting end of file in /in/DEPnp on line 48
Process exited with code 255.
Output for 5.3.21 - 5.6.17
Parse error: syntax error, unexpected '}' in /in/DEPnp on line 48
Process exited with code 255.