I have a select() method in a database class, that has an optional boolean argument $sum. This argument is used to say if the method should use COUNT(*) or not too.
I would like to show a warning, like those normal PHP errors, if I try to access $class->sum if the attribute is not set (i.e. when I call select() with $sum == false.
Is there any way to show a warning like this, or I should just echo an error and be happy?