Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76687 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59251 invoked from network); 19 Aug 2014 09:12:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2014 09:12:11 -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.192.170 as permitted sender) X-PHP-List-Original-Sender: zxcvdavid@gmail.com X-Host-Fingerprint: 209.85.192.170 mail-pd0-f170.google.com Received: from [209.85.192.170] ([209.85.192.170:47135] helo=mail-pd0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/B0-55441-8E413F35 for ; Tue, 19 Aug 2014 05:12:09 -0400 Received: by mail-pd0-f170.google.com with SMTP id g10so9337611pdj.29 for ; Tue, 19 Aug 2014 02:12:03 -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=Ey/EsjIFJbgqOTuvUPqW+dbgcODLkgbxkF3kxYXS5qE=; b=kXgc/3u4heukfQ8rZJlyKkeV0WynW8oenS+GW/+/iqCwk7aZgFBQ98cOKMzNAykkZP mYsSlmA4CUFaqwyAuoTRcE3BNR+nc2w94u04ImpkxtS4T34eOwqcvW8rp3pOJtQQjePy HKv7alKCFDUG5EfKZrJdF+tDLnKuDyaJ5uVwj3pAFKmneaIbYYJXDwvByizanThIfYzq u6ZuZyueQVn81Xx+syD+T7DCywKD273vWTgXoZZO2rzl1cFa3UNzhmj7n4vkytVFnWYt n/3In5d/sGLBliacAz7k9KE2ZiiHWqsEoS0ePQushDGcEWjvdp3bb6Ps4DK7OtU15WxW 2zHQ== X-Received: by 10.70.94.100 with SMTP id db4mr48332591pdb.122.1408439523638; Tue, 19 Aug 2014 02:12:03 -0700 (PDT) Received: from [10.0.20.170] ([103.14.214.22]) by mx.google.com with ESMTPSA id ks7sm1047467pbc.26.2014.08.19.02.12.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 02:12:03 -0700 (PDT) Date: Tue, 19 Aug 2014 17:11:54 +0800 To: Pierre Joye Cc: Derick Rethans , Aaron Lewis , PHP Internals Message-ID: <96C1DD0341854844A3A3E43FA3608A2F@gmail.com> In-Reply-To: References: <86EEE03317124B84B62883DBE41C4ADD@gmail.com> <35D406B0A53A43FEAF472D9FC8371187@gmail.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="53f314da_168efe17_142" Subject: =?utf-8?Q?=E5=9B=9E=E5=A4=8D=EF=BC=9A_?=[PHP-DEV] Re: =?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) --53f314da_168efe17_142 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > On Tue, Aug 19, 2014 at 10:55 AM, Derick Rethans wrote: > > On Tue, 19 Aug 2014, Wei Dai wrote: > > =20 > > > > On Mon, 18 Aug 2014, Wei Dai wrote: > =20 > > > so, i have two options: > > > =20 > > > 1. copy the duplicate code into my extension, It can be fast in thi= s > > > way, but the code is not beautiful. > > > =20 > > > 2. call call=5Fuser=5Ffunction(=5Fex) , it=E2=80=99s slower than th= e first option, > > > but the code is more simple and beautiful than the first option. > > > =20 > > =20 > > =20 > > or: > > =20 > > 3. refactor the functionality in PHP so that trim or others *can* be > > used in extensions. > > =20 > =20 > =20 > Best option, while not possible for existing releases, a good example (= trim): > =20 > http://lxr.php.net/xref/phpng/ext/standard/string.c=23784 > =20 trim is just an example, we can call it 'x'. x is a php function and it doesn't have a common C api. --53f314da_168efe17_142--