Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21181 invoked from network); 19 Aug 2014 01:39:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2014 01:39:40 -0000 Authentication-Results: pb1.pair.com header.from=zxcvdavid@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zxcvdavid@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.43 as permitted sender) X-PHP-List-Original-Sender: zxcvdavid@gmail.com X-Host-Fingerprint: 209.85.220.43 mail-pa0-f43.google.com Received: from [209.85.220.43] ([209.85.220.43:48546] helo=mail-pa0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/F0-14556-BDAA2F35 for ; Mon, 18 Aug 2014 21:39:39 -0400 Received: by mail-pa0-f43.google.com with SMTP id lf10so8759551pab.2 for ; Mon, 18 Aug 2014 18:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=aoZZ71l0R1P+XYSegqm7IKoaNgZ4cRtoSQgI8GyMy4c=; b=kZjxu0bUVz+UMTP5OaaHiVuauTdC5Jo6GTS2j5IAE5JHQG8vXeQGiC5h/dggbAGOXy +IIo+SBhC8GR0AYomUdqT3FK+Phh+TNTWIf+bxc/H0NS2QBVGpytKVV2Y3jwkg/QOb57 61BU8Py9WeCWhQVyL99nwM5zzHs2rhOfqljIf0YAnqcMk5RBq32tsWGtpj6SMPuPwxMi JJKI15GSkySSWxMOgsIhU07gRMFMIvs2TafB8vE0hd6+xdFlfliACwfWxaOI1Tp7EbpG 2ODaHodZrRv69XtMIRsa4TufwSbKY2YhAz3LJFcsR5qD/rmqqYsUYGBArhKxeulIYIES e9QQ== X-Received: by 10.68.245.135 with SMTP id xo7mr14072845pbc.161.1408412370398; Mon, 18 Aug 2014 18:39:30 -0700 (PDT) Received: from [10.0.20.170] ([103.14.214.22]) by mx.google.com with ESMTPSA id qy8sm63815873pab.12.2014.08.18.18.39.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Aug 2014 18:39:29 -0700 (PDT) Date: Tue, 19 Aug 2014 09:39:14 +0800 To: Derick Rethans Cc: Aaron Lewis , PHP Internals Message-ID: <35D406B0A53A43FEAF472D9FC8371187@gmail.com> In-Reply-To: References: <86EEE03317124B84B62883DBE41C4ADD@gmail.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="53f2aac2_63de60cd_142" Subject: =?utf-8?Q?=E5=9B=9E=E5=A4=8D=EF=BC=9A_?=[PHP-DEV] =?utf-8?Q?=E5=9B=9E=E5=A4=8D=EF=BC=9A_?=[PHP-DEV] How should I call a PHP function From: zxcvdavid@gmail.com (Wei Dai) --53f2aac2_63de60cd_142 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Derick, =20 > On Mon, 18 Aug 2014, Wei Dai wrote: > =20 > > > I'm trying to call a function inside a module, a PHP=5F=46UNCTION. > > > =20 > > > Other than zend=5Feval=5Fstringl, what's the direct way to do it=3F= > > =20 > > Please refer to call=5Fuser=5Ffunction and call=5Fuser=5Ffunction=5Fe= x. > =20 > Actually, you need to be careful with this. If you are calling another = =20 > PHP function in the same extension, do *not* use call=5Fuser=5Ffunction= . =20 > Instead, create a common C function that you can call from whereever yo= u =20 > need to. call=5Fuser=5Ffunction(=5Fex) is not fast. > =20 i agree. =20 here is a scenario: i was wrote an extension, and i need to call some PHP function like =E2=80= =9Cstrtr (http://lxr.php.net/s=3Fdefs=3Dstrtr&project=3DPHP=5F5=5F4)=E2=80= =9D =E2=80=9C*trim=22 or a function in =20 another extension but it doesn=E2=80=99t have a common C function. Howeve= r, i don=E2=80=99t want to copy the implement code into my extension. 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=5Fuser=5Ffunction(=5Fex) , it=E2=80=99s slower than the firs= t option, but the code is more simple and beautiful than the first option= . cheers, Wei Dai --53f2aac2_63de60cd_142--