Hi.

Christopher Vogt wrote:
I fetch records a database. Sometime it happens that a record does not
exist anymore. Let's assume it's a user, then $user will be NULL.

echo $user['fullname']; // no error at all, $user['fullname'] === NULL

Shouldn't this at least trigger a Notice?

Check your error handling settings, probably warnings/notices are disabled.

echo $user->get_fullname(); // Fatal error

Well, is $user an object? If not, well, better not call a method on it.

Regards,
Karsten

PS: I am not sure this is a topic for php.internals...

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to