"Bart de Boer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Bart de Boer wrote: >> Bart > > > I was wrong when I said that objects would be more consistent with the > behaviour in JavaScript. When I said that I had the following JavaScript > syntax in mind: > > object.property; > > of which the PHP equivalent would be: > > $object->property; > > But then Douglas Crockford got me thinking. And after snooping around at > crockford.com I (re)discovered that objects can also be accessed like: > > object['property']; > > Which would be consistent with: > > $object['property']; > > So, making a long story short: And FWIW: I'm all +1 for implementing it as > associative arrays. :)
The issue, though is that PHP's properties can be more than hashes (see __get and __set), and setting (or reading) them can have useful side-effects (think ORMs or RPC). For people used to programming procedurally, you can continue using associative arrays. But for people using objects, i imagine that a mapping step from JSON encoded string to object would be the general case. If so, we should by all means optimize for this case. PDO and SOAP have mapping code, so there is prior art we can refer to. l0t3k -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php