News for hackers. Stuff that matters.
Re:Strangest Language Features by xd on Thursday December 15, 2011 @10:59AM (#3356636)
PHP; converts array('123' => 0); into array(123 => 0);

Which I came across as a problem when working with mongodb as it will only except strings as keys (not sure if this is enforced by PHP and/or mongo). Luckily you can create a class with numeric properties and pass that to mongodb which will then be treated as strings i.e

$array = new stdClass; $array->{123} = 0;

Re:Strangest Language Features by derleth on Thursday December 15, 2011 @02:04PM (#3357424)
> only except strings

A strange feature of the English language is that this doesn't work; you have to use 'accept' here.