After installing the latest PHP version (v4.1lp1 or something), the website I was working on didn't work anymore. I went bughunting, found out what it was, and thought that maybe somebody out here might like to share in my so-called new experience.
To store user-information (for example), I had a session-variable $user, and simply used -> to add attributes to the variable (a non-initialized 'object'), like
$user->login = "vincent";
$user->password = "secret!";
This worked great, even without ever defining some class! Therefore I can imagine that a lot of folks out there do the same as I do. (Who wants to define a class just to store some basic attributes?).
I had no problems with migrating from PHP3 to PHP4.0; the above kept working (as it should!). However, installing the latest version resulted in many weird errors I at first didn't understand. The solution: define a class! All I did was:
class User { var $login; var $password; }
session_register("user");
if (!$user) user = new User;
And that's that!
Anybody happy to hear this? I can imagine...
Greetings and happy coding :-),
Vincent