3 ms·
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 wo
by swivelmaster 15y ago
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?
- TamDenholm 15y agoYou could write that if you wanted, using __call, would be like 10 lines of code or something.
- swivelmaster 15y agoPhp arrays don't act as objects and have no methods, so I'm not sure what you are suggesting.
- abredow 15y agoYou can create an object that implements the ArrayAccess interface, but it doesn't extend the native array object in the traditional sense.