Re: [PHP-GENERAL] Can I use Functional Pointer? / Javascript bracelet conflict ?

[email protected] (Jan Dvorak)
Newsgroups php.general
Organization MathAn Praha, Ltd.
Message-ID <[email protected]>
Hi,

Lin Zhemin wrote:
> 
> 1. Can I use Functional Pointer (a pointer that refers to a function) ?
>    This would be a basic to polymorphism (since OOP isn't highly
>    supported in PHP3).  If yes, how can I ?

You can make a call with variable name:

 $fname = "do_this_and_that";
 $retval = $fname ( $args );

I don't think there will be pointers,
the language has so far been able to avoid them
(which is a good think for a scripting language, IMHO).

And I'm not sure if this variable name
trick works with object method calls.
Anyway, if all else fails, there's eval()  :-)

Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.