Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81625 invoked from network); 23 Jun 2015 21:46:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2015 21:46:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.172 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.172 mail-pd0-f172.google.com Received: from [209.85.192.172] ([209.85.192.172:34371] helo=mail-pd0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/E1-04861-4A3D9855 for ; Tue, 23 Jun 2015 17:46:13 -0400 Received: by pdbki1 with SMTP id ki1so15522402pdb.1 for ; Tue, 23 Jun 2015 14:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=8BEiQMj9PYxKg3JVpQJPt6tK5YgW1XwyJtX87pOIy48=; b=H8lqFMx00az3rFCySmXW7qVecNsqsMph2CkuOcFbwuKELuXU549wV2ThIjzDsPwn0h kKtY1xZ2lqLktdM6zeJIJUiO5ZBPUq3o5quTdpowIOrWzemKBH1l0ddHLZarh+ys0me9 wcghu6nn6cmcklnWSYUnXpCbt1FRAt1IiQg0SlJqxOPuWoe03wPjNfgO5wBUMki0xJ45 PLv8XZ6nrn+vsbjWP07XJf9zjm+BJ5r7dZQ8YlpvKhMN92uNFxWQM/sSyjHPsfv12p10 JNqWCMB5yAb1daSYgRoiqx2Omks89imzruR/daRqevu0lQ2gHsXFGHvSY353IkhfYvM1 Epzw== X-Received: by 10.70.88.43 with SMTP id bd11mr72630906pdb.7.1435095970084; Tue, 23 Jun 2015 14:46:10 -0700 (PDT) Received: from Stas-Air.local (tan1.corp.wikimedia.org. [198.73.209.1]) by mx.google.com with ESMTPSA id pb6sm537915pbc.75.2015.06.23.14.46.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 14:46:09 -0700 (PDT) Message-ID: <5589D39F.7030602@gmail.com> Date: Tue, 23 Jun 2015 14:46:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yasuo Ohgaki , "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Optimizing php_html_entities() From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Current php_html_entities() convert int/float/etc to string, then convert > it. > int/float/etc is not required to be escaped. Optimize it by simply > converting them to string. I'm not sure this is the case that is used frequently enough to actually optimize for it in PHP code. If for particular app it is in the hot path, wouldn't it be easier to just add a if(is_numeric()) or is_int() check? -- Stas Malyshev smalyshev@gmail.com