I programmed PHP for a while, and I was annoyed by inconsistency in procedural functions (especially Strings and Arrays).
With object support, I wanted PHP to have its own implementation of arrays and strings as objects, so that I could write code like:
$arr = new Array('foo', 'bar'); $item = $arr->pop();
Creating an object matched by an array is not too difficult, however, there is considerable success. All this will ultimately be a wrapper for array constructions anyway.
Are there any other basic objects that PHP should have for object oriented PHP?
EDIT to add:
This is NOT about how you can use arrays as objects; in fact, I specifically do not want to discuss arrays in the answer, since this is not a question. I used arrays as an example, and nobody seemed to read the question. I am interested in other classes / objects that should exist primarily in PHP.
source share