My class looks similar to this:
class Foo {
const UNKNOWN = 2;
public function doStuff($var) {
if($var==UNKNOWN) {
echo "Unknown state";
return;
}
// other stuff
}
}
However, I'm getting this error in doStuff():
Use of undefined constant UNKNOWN - assumed 'UNKNOWN'
What am I doing wrong? Can't I define custom constants?