On Wed, Apr 21, 2010 at 04:18:47PM +0200, Jacob Oettinger wrote:
>
> On 21/04/2010, at 16.03, Stan Vassilev wrote:
> >
> > Ahem. We all secretly know how it should've been from the very start.
> > Pseudo-methods for the basic types.
> >
> > $array->merge($array2);
> > $string->len();
> >
>
> Yes. Maybe implemented so that they can be called like functions in a
> namespace for each type with the "this" value as the first param. So that:
>
> $array->merge($array2);
> <=>
> \array\merge($array, $array2);
>
> and
>
> \string\len($string);
> <=>
> $string->len();
We then run into a danger of conflict with a user defined namespace \array.
Could I suggest the _ prefix trick, so that the above, if we do it, becomes:
\_array\merge($array, $array2);
\_string\len($string);
Ie all 'internal' ones start '_', such names *should* not be used by
programmers.
'should', I did not write 'may'.
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT
Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information:
http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php