Quasar Jarosz wrote:
== Objects are hashtables ==
Member variables can be added and removed dynamically. It is your fundamental right as a PHP programmer to do this, nobody will ever take it away from you.
Do you know of anywhere i can get some more information on this behavior? I believe i have read every page of the PHP manual and I had no idea this behavior was possible!
It doesn't appear to say it, no. But it's certainly not the only undocumented feature in PHP. For example, the essential syntax:
$class = 'ClassName'; $obj = new $class;
...is not in the manual either, it's only in a user comment. Luckily the PHP developers are sufficiently concerned about backwards compatibility to avoid breaking things like this.
I know what I know about PHP thanks to a few years of experience. If you want to learn more, you could try:
* Reading other people's PHP code, there's plenty of open source projects around * Reading mailing lists and blogs * Reading the PHP source code
The popular techniques are least likely to be broken by future PHP releases, so it helps to read lots of code and know what is popular.
-- Tim Starling