回复: [PHP-DEV] Re: 回复: [PHP-DEV] 回复: [PHP-DEV] How should I call a PHP function
| From: | Wei Dai | Date: | Tue, 19 Aug 2014 09:11:54 +0000 |
| Subject: | 回复: [PHP-DEV] Re: 回复: [PHP-DEV] 回复: [PHP-DEV] How should I call a PHP function | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-76687@lists.php.net to get a copy of this message | ||
> On Tue, Aug 19, 2014 at 10:55 AM, Derick Rethans <derick@php.net (mailto:derick@php.net)>
> wrote:
> > On Tue, 19 Aug 2014, Wei Dai wrote:
> >
> > > > On Mon, 18 Aug 2014, Wei Dai wrote:
>
> > > so, i have two options:
> > >
> > > 1. copy the duplicate code into my extension, It can be fast in this
> > > way, but the code is not beautiful.
> > >
> > > 2. call call_user_function(_ex) , it’s slower than the first option,
> > > but the code is more simple and beautiful than the first option.
> > >
> >
> >
> > or:
> >
> > 3. refactor the functionality in PHP so that trim or others *can* be
> > used in extensions.
> >
>
>
> Best option, while not possible for existing releases, a good example (trim):
>
> http://lxr.php.net/xref/phpng/ext/standard/string.c#784
>
trim is just an example, we can call it 'x'.
x is a php function and it doesn't have a common C api.