Re: Re: ArrayObject - Posibillity to add key => value pair per default?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In olden times, of PHP 3, you could for sure use ->x and [x] interchangeably, as an Object then was little more than a C struct with a couple functions tacked on, as was an array.

I think PHP 3 Object may actually have been implemented as a PHP array with some additional C functions on it, come to think of it...

Anyway, I believe this feature has survived to this day, but would not swear to it in court.

I think your code will be more readable if you stick with one style or the other, personally, but I suppose there may be cases where [x] is equally clear.

Note that $customClass->key = $value; would probably also work, and be more in tune, even if it's not a declared member variable of the class.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux