News for hackers. Stuff that matters.
Re:PHP Short Syntax for Arrays: developers say no. by swivelmaster on Tuesday May 31, 2011 @09:21PM (#2605462)
Wouldn't it be nice if PHP arrays acted as objects and all of those functions were methods?

$newArray = $array->map("function_name");

Not gonna happen, but would be nice. Any extensions doing this?

Re:PHP Short Syntax for Arrays: developers say no. by TamDenholm on Tuesday May 31, 2011 @10:08PM (#2605603)
You could write that if you wanted, using __call, would be like 10 lines of code or something.
Re:PHP Short Syntax for Arrays: developers say no. by swivelmaster on Tuesday May 31, 2011 @10:28PM (#2605659)
Php arrays don't act as objects and have no methods, so I'm not sure what you are suggesting.
Re:PHP Short Syntax for Arrays: developers say no. by abredow on Tuesday May 31, 2011 @11:40PM (#2605853)
You can create an object that implements the ArrayAccess interface, but it doesn't extend the native array object in the traditional sense.