Posted by Oliver Grδtz on 11/15/05 02:51
alee.indy@gmail.com schrieb:
> Basically, I want to add default methods to the PHP string object so
> that I can do something like:
>
> $stringvar = "hello";
>
> $stringvar -> append(" world"); // where append is some kind of
> prototyped function i define
>
> echo $stringvar; // "hello world"
>
> is this at all possible?
Surprise: There ain't even a string object!
PHP is all about speed through native code.
So strings are primitive types.
But for your example, as for most of the common string operations:
Do not reinvent the wheel! All common string manipulation functions are
already implemented as fast compiled C-code...
$stringvar='hello';
$stringvar.=' world';
OLLi
[Back to original message]
|