Welcome Guest, Not a member yet? Register   Sign In
Using (@) error suppression on Undefined Variables
#2

[eluser]bigtony[/eluser]
It's VERY bad practice to use undefined variables, and therefore the use of @ should only be needed on rare occassions.

If you are using CI sessions then the variable won't be undefined in any case:
Code:
$logged_in = $this->session->userdata('logged_in');
The above will set $logged_in to FALSE if the actual logged_in value (in the session) is undefined. So you then won't need to use @.


Messages In This Thread
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 12:00 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 01:43 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 03:07 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 03:17 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 03:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB