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 ($customerDetails['billing'] as $key => $value) { if (!isset($value)) { $value = ""; } echo "Key: $key, Value: $value"; }
Output for 4.3.0 - 7.1.0
Key: firstname, Value: SidKey: middlename, Value: RKey: lastname, Value: McLaughlinKey: company, Value: