3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $formData = array(); echo 'empty($formData[chain_id]): '; var_dump(empty($formData['chain_id'])); echo "\n"; echo '$formData[chain_id] === \'0\': '; var_dump($formData['chain_id'] === '0'); echo "\n"; $formData['chain_id'] = 0; echo 'empty($formData[chain_id]): '; var_dump(empty($formData['chain_id'])); echo "\n"; echo '$formData[chain_id] === \'0\': '; var_dump($formData['chain_id'] === '0'); echo "\n"; $formData['chain_id'] = 1; echo 'empty($formData[chain_id]): '; var_dump(empty($formData['chain_id'])); echo "\n"; echo '$formData[chain_id] === \'0\': '; var_dump($formData['chain_id'] === '0'); echo "\n";
Output for 5.3.0 - 7.1.0
empty($formData[chain_id]): bool(true) $formData[chain_id] === '0': Notice: Undefined index: chain_id in /in/B89FO on line 8 bool(false) empty($formData[chain_id]): bool(true) $formData[chain_id] === '0': bool(false) empty($formData[chain_id]): bool(false) $formData[chain_id] === '0': bool(false)
Output for 4.3.0 - 5.2.17
empty($formData[chain_id]): bool(true) $formData[chain_id] === '0': Notice: Undefined index: chain_id in /in/B89FO on line 8 bool(false) empty($formData[chain_id]): bool(true) $formData[chain_id] === '0': bool(false) empty($formData[chain_id]): bool(false) $formData[chain_id] === '0': bool(false)