Php – Why does the following PHP code fail

PHP

define('test',2);
if(isset(test))echo 'hi';

Best Answer

isset is meant for variables. You should use defined instead:

define('test',2);
if(defined('test')) echo 'hi';

You're also missing a bracket after the isset.