Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99436 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47938 invoked from network); 7 Jun 2017 17:15:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2017 17:15:11 -0000 Authentication-Results: pb1.pair.com header.from=ben.coutu@zeyos.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ben.coutu@zeyos.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zeyos.com designates 88.99.153.70 as permitted sender) X-PHP-List-Original-Sender: ben.coutu@zeyos.com X-Host-Fingerprint: 88.99.153.70 mx.zeyos.com Received: from [88.99.153.70] ([88.99.153.70:33850] helo=mx.zeyos.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/C1-27119-A9438395 for ; Wed, 07 Jun 2017 13:15:09 -0400 Received: from mx.zeyos.com (localhost [127.0.0.1]) by mx.zeyos.com (Postfix) with ESMTP id 0E59574D18 for ; Wed, 7 Jun 2017 19:15:02 +0200 (CEST) Authentication-Results: mx.zeyos.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=zeyos.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zeyos.com; h= content-transfer-encoding:content-type:content-type:mime-version :to:subject:subject:from:from:date:date; s=dkim; t=1496855701; x=1497719702; bh=HUANFKIkIKeWp4XMb5/EMy/8yzRA7TDt4DPJAaFqhaQ=; b= n8HznPPMBBXyIE8/T6hdLlzOqYk217aVheeyGLxH9uibmrEEB4qy1gE8aLwJscfR DkCmpSHZvZpErTd3jnJ2xpi8ZhljDae+u69bmq+lkZbBEKIg2jSyXpeObjtsde9j Lp8Smac0jDNQ0Wgbqdn4lCTxDr3mLLtbriEff6axvLw= X-Virus-Scanned: Debian amavisd-new at mx.zeyos.com Received: from mx.zeyos.com ([127.0.0.1]) by mx.zeyos.com (mx.zeyos.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id dZBDajPysGNQ for ; Wed, 7 Jun 2017 19:15:01 +0200 (CEST) Received: from [81.171.8.203] (unknown [81.171.8.203]) by mx.zeyos.com (Postfix) with ESMTPSA id C73D074D14; Wed, 7 Jun 2017 19:15:01 +0200 (CEST) Date: Wed, 07 Jun 2017 19:15:01 +0200 To: Dmitry Stogov Cc: PHP Internals , Xinchen Hui MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20170607171502.0E59574D18@mx.zeyos.com> Subject: Basic string comparison functions still use old parameter parsing API From: ben.coutu@zeyos.com (Benjamin Coutu) Hi Dmitry,=0A=0AI just noticed that all basic string comparison functions i= n Zend/zend_builtin_functions.c, especially "strcmp", "strncmp", "strcasecm= p", "strncasecmp" still use the old and inefficient parameter parsing API, = unlike similar functions in ext/standard/string.c such as "substr_compare",= "strtok", "str(i)str", "str(i)pos", "strr(i)pos", "strrchr" that already c= onsistently use the new efficient macro-based API.=0A=0AI think one can con= sider "str(n)cmp" and "str(n)casecmp", etc. at least as important as "subst= r_compare", especially considering that these are wrappers around very basi= c functions that often get called in very hot code or inside tight loops (e= .g. sorting). I therefore recommend changing those 4 functions in Zend/zend= _builtin_functions.c to use ZEND_PARSE_PARAMETERS_* macros for PHP 7.2.=0A= =0AWhat do you think?=0A=0A-- =0A=0ABenjamin Coutu=0AZeyOS, Inc.