3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo '$formData = array();'; $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"; echo "\n"; echo '$formData[\'chain_id\'] = 0;'; $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"; echo "\n"; echo '$formData[\'chain_id\'] = 1;' $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"; echo "\n";
Output for 5.4.0 - 5.4.18
Parse error: syntax error, unexpected '$formData' (T_VARIABLE), expecting ',' or ';' in /in/1dtOe on line 24
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /in/1dtOe on line 24
Process exited with code 255.