Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76686 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57624 invoked from network); 19 Aug 2014 09:04:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2014 09:04:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.44 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.44 mail-qa0-f44.google.com Received: from [209.85.216.44] ([209.85.216.44:50019] helo=mail-qa0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/50-55441-FF213F35 for ; Tue, 19 Aug 2014 05:04:00 -0400 Received: by mail-qa0-f44.google.com with SMTP id f12so5399103qad.31 for ; Tue, 19 Aug 2014 02:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=p83U25xSwJn4AC+R8ikTsIvl9693tfvy8iwKoBj3B2s=; b=VTzspCqdBYWN4BltqxrUeQgyDXhxbWXEFs04EnqtV4AD30JR/UpGnVlCiFib38jQhH CUlVZvX7oPsPX7MO4v7Es8LrVqWi2q7aHE8yeuWO/72k8sb2zKqJ6Uxs1epSFcjORvM/ 5LlfwY+tsGUCDa1nU9TMpfR+cOao0ZoAG1cMmIP9XbqAQPKg8KW/BwLWtDzUtL4zAyDO rUsWLV5rX8Ycrfbry9orU+q7qtXQJ7O1W2tBDgoK1TcIVbUlSVWke4rrTsMVAso4AYZl o1WXIuGqk00yBfIYy5BpbzK8MUV+hBihmQlDWgukjJz5MZAAYl25+zbOEL6QiukjRQZW mwNQ== MIME-Version: 1.0 X-Received: by 10.140.85.135 with SMTP id n7mr60796931qgd.22.1408439037297; Tue, 19 Aug 2014 02:03:57 -0700 (PDT) Received: by 10.140.95.146 with HTTP; Tue, 19 Aug 2014 02:03:57 -0700 (PDT) In-Reply-To: References: <86EEE03317124B84B62883DBE41C4ADD@gmail.com> <35D406B0A53A43FEAF472D9FC8371187@gmail.com> Date: Tue, 19 Aug 2014 11:03:57 +0200 Message-ID: To: Derick Rethans Cc: Wei Dai , Aaron Lewis , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: =?UTF-8?B?UmU6IFtQSFAtREVWXSBSZTog5Zue5aSN77yaIFtQSFAtREVWXSDlm57lpI3vvJogW1BIUA==?= =?UTF-8?B?LURFVl0gSG93IHNob3VsZCBJIGNhbGwgYSBQSFAgZnVuY3Rpb24=?= From: pierre.php@gmail.com (Pierre Joye) On Tue, Aug 19, 2014 at 10:55 AM, Derick Rethans 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=E2=80=99s slower than the first opt= ion, >> 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 Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org