Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93687 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88550 invoked from network); 1 Jun 2016 18:24:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2016 18:24:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.114 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.114 mail-by2on0114.outbound.protection.outlook.com Received: from [207.46.100.114] ([207.46.100.114:12310] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/54-63812-4582F475 for ; Wed, 01 Jun 2016 14:24:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=FPB+C31AoIp0iRDGSRirzaQ2FBfntDMP6lGcDiSPbhg=; b=dP9BjaoYMhxiuVx/dSn3K/rhTATS38LYOGLwdVnpkMOEAnUs4Xhhxh8plglExanZnt+EJmo83Q6F+SETWDVwm3lIPzg8df0VwTnK7Uuz9yAuzjEJdM33h1AO2PMt66jtO3K0HutDEF2ZZJGwSG3Fk7qScvopt10DZW9z6wmGnp8= Received: from CY1PR0201MB1786.namprd02.prod.outlook.com (10.163.55.19) by CY1PR0201MB1786.namprd02.prod.outlook.com (10.163.55.19) with Microsoft SMTP Server (TLS) id 15.1.506.9; Wed, 1 Jun 2016 18:24:16 +0000 Received: from CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) by CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) with mapi id 15.01.0506.013; Wed, 1 Jun 2016 18:24:16 +0000 To: Joe Watkins CC: PHP internals , Nikita Popov Thread-Topic: [PHP-DEV] [RFC] Replace "Missing argument" warning with "Too few arguments" exception Thread-Index: AQHRu/OUwTmtJFKWzU6EHD8pGhsbrp/U4h+AgAAIZmk= Date: Wed, 1 Jun 2016 18:24:16 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: pthreads.org; dkim=none (message not signed) header.d=none;pthreads.org; dmarc=none action=none header.from=zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: ae3b2efe-12fb-4a72-38f9-08d38a49f0ed x-microsoft-exchange-diagnostics: 1;CY1PR0201MB1786;5:GDC0wxKBRoLvpmoIQpeHXocVQEUWnXM3LSxP3GtmRr555aAlcf8ZReL5XHZPey3NbiIZUlYewVNsQ/h6CQbyc6U5Z1B2p0giDCTJYBwS5tCroeXKh2velM3E9RQPnXbuGrKrVgF7lgnFHpfiX0zbdQ==;24:/O+MaNY8aBNKLOXi3wEZuPdzZkkAGKT4vfvDfqjKa2qxF8L7UnQHcS/sH3Uggn9MYnvmrCNyp+TbPzpllYIGZzeJZMfmg5PmB81ruV6eu/M=;7:tO68KUrc9zaXuHYIkbq4U/4p0s7vOTko1ogsMowUmEs4kxYM3w1zLY6Te7gTOgDwkpY9/bL3l5oxLjTGZ//IyloY8l3vhynaBKRO50CzO3RuPJklu3fRxJ063Y0dRYf2eZaNj2sD02H9XbverbHjBltga3MdHK88lnpPC0FeUUN7tkkzUFHLHb57xyA66piR x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1786; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:CY1PR0201MB1786;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1786; x-forefront-prvs: 096029FF66 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(24454002)(377454003)(74316001)(19627405001)(106116001)(16799955002)(86362001)(92566002)(15975445007)(77096005)(5004730100002)(189998001)(4326007)(110136002)(19617315012)(10400500002)(2950100001)(81166006)(5008740100001)(11100500001)(8676002)(19625215002)(2900100001)(6116002)(54356999)(3846002)(586003)(3280700002)(76176999)(122556002)(102836003)(99286002)(3660700001)(561944003)(19580395003)(19580405001)(16236675004)(9686002)(2906002)(66066001)(76576001)(33656002)(5002640100001)(5003600100002)(50986999)(8936002)(87936001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0201MB1786;H:CY1PR0201MB1786.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_CY1PR0201MB178644D71E69F51FD61E12E4BF470CY1PR0201MB1786_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2016 18:24:16.1820 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1786 Subject: Re: [PHP-DEV] [RFC] Replace "Missing argument" warning with "Too few arguments" exception From: dmitry@zend.com (Dmitry Stogov) --_000_CY1PR0201MB178644D71E69F51FD61E12E4BF470CY1PR0201MB1786_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable In the SSA optimisation framework (part of opcache), we predict and propag= ate types of variables. We also may detect situations when some variables may be undefined. If variable can't be "undefined", we may avoid unnecessary run-time checks = (e.g .like in ZEND_ADD_LONG handler). Local variables almost always initialized before usage, but with exiting be= havior, function arguments always may be uninitialized. $ sapi/cli/php -d opcache.opt_debug_level=3D0x400000 2>&1 ../Zend/bench.php= | less ... fibo_r: ; (lines=3D14, args=3D1, vars=3D1, tmps=3D3, ssa_vars=3D9, no_loops= ) ... #1.CV0($n) [undef, any] =3D RECV 1 #2.T1 [bool] RANGE[0..1] =3D IS_SMALLER #1.CV0($n) [undef, any] int= (2) JMPZ #2.T1 [bool] RANGE[0..1] BB2 ... With the patch $n won't include "undef" anymore. Thanks. Dmitry. ________________________________ From: Joe Watkins Sent: Wednesday, June 1, 2016 8:42:49 PM To: Dmitry Stogov Cc: PHP internals; Nikita Popov Subject: Re: [PHP-DEV] [RFC] Replace "Missing argument" warning with "Too f= ew arguments" exception Evening, Could you expand on the "obvious optimization opportunities" in the doc= ument ? They are not obvious to me, and even if they were, this document is par= t of the history of this change, so a little more detail would be nice. Cheers Joe On Wed, Jun 1, 2016 at 11:55 AM, Dmitry Stogov > wrote: hi, Please take a look into the proposal. https://wiki.php.net/rfc/too_few_args The RFC is extremely simple (both proposal and implementation) and almost c= ompletely described by the email subject. I think, this mini-RFC doesn't need 2-weeks discussion period, so I'm going= to start the vote on next week. Thanks. Dmitry. --_000_CY1PR0201MB178644D71E69F51FD61E12E4BF470CY1PR0201MB1786_--