NYCPHP Meetup

NYPHP.org

[nycphp-talk] Handling empty values in hashes

paul at devonianfarm.com paul at devonianfarm.com
Thu Jul 17 13:54:35 EDT 2008


I've been "cross-training" in a few languages and been thinking about differences in semantics in dictionaries (associative arrays) in common languages.  I wrote an article at:

[javascript:void(0);/*1216316970142*/] http://gen5.info/q/2008/07/17/the-semantics-of-dictionaries-maps-and-hashtables/

Which compares and contrasts dictionary semantics in four popular languages,  including PHP.  In a lot of ways I find the behavior of the

$value=$array[$key]

operation works well,  but I find it pretty obnoxious that:

(1) This throws warnings on a missing keys if a certain bit is set in error_reporting,  and
(2) It's not possible to have strict checking of variable names without also turning on strict checking of array keys  (which I'd usually expect to be a bit sloppier)

Any thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080717/735957bd/attachment.html>


More information about the talk mailing list