Hi,
The code is:
error_reporting(E_ALL);
$user->username = "new user";
echo $user->username;
I expect some error or warning, but I get none - why?
Hi,
The code is:
error_reporting(E_ALL);
$user->username = "new user";
echo $user->username;
I expect some error or warning, but I get none - why?
error_reporting(E_ALL | E_STRICT);
Will give: "PHP Strict Standards: Creating default object from empty value"
In PHP 5 a new error level E_STRICT is available. As E_STRICT is not included within E_ALL you have to explicitly enable this kind of error level. Enabling E_STRICT during development has some benefits. STRICT messages will help you to use the latest and greatest suggested method of coding, for example warn you about using deprecated functions.