So far I have a PHP class with the constructor
public function __construct ($identifier = NULL)
{
// Return me.
if ( $identifier != NULL )
{
The constructor is suppose to create an object. Since in php booleans are not considered to be objects the only option is null. Otherwise use a workaround i.e. write a static method which creates the actual object.
public static function CheckAndCreate($identifier){
$result = self::loadUser();
if($result === true){
return new EmailClassNameHere();
}else{
return false;
}
}