- defined: documentation ( source)
- constant: documentation ( source)
<?php
const A = false;
$constant = 'A';
if (defined($constant) && ! is_scalar(constant($constant)) && ! is_resource(constant($constant)) && constant($constant) !== null) {
echo "Yes, I am non-scalar and non-resource constant!\n";
}