3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $customerDetails = array(); $customerDetails['billing']['firstname'] = "Sid"; $customerDetails['billing']['middlename'] = "R"; $customerDetails['billing']['lastname'] = "McLaughlin"; $customerDetails['billing']['company'] = NULL; foreach ($k as $customerDetails['billing']) { print $v; }
Output for 5.5.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: k in /in/nZ4UY on line 9 Warning: Invalid argument supplied for foreach() in /in/nZ4UY on line 9
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: k in /in/nZ4UY on line 11 Warning: Invalid argument supplied for foreach() in /in/nZ4UY on line 11
Output for 5.2.3 - 5.4.45
Warning: Invalid argument supplied for foreach() in /in/nZ4UY on line 9
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.2.2
<br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/in/nZ4UY</b> on line <b>9</b><br />
Output for 4.3.11