Does PHP have an equivalent of JavaScript's prototype object?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Does PHP have an equivalent of JavaScript's prototype object?

From: <alee.indy@gmail.com>
Date: Mon Nov 14 2005 - 08:48:20 CET

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?

thanks!!
Received on Mon Nov 21 03:02:04 2005