Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108603 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71382 invoked from network); 15 Feb 2020 19:56:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Feb 2020 19:56:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EE46A1804AB for ; Sat, 15 Feb 2020 10:11:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2076.outbound.protection.outlook.com [40.92.18.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 15 Feb 2020 10:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k2GIFZYxNMTp9Efmb0DMUIbOiDAmo+DOpRHskaDvfV0ddyhiWO3Cmj//2B637k4akl1K+u/XNrQ28WZvcsQZ5CJN8mftaXMV+K4bgUrASV8jYvbgLDOPg16v0a2bVff1Me768Bc9L/IV8mwrsJnDAaYj3vom58naC7/oelo6nf6wsh3uZaxTVXPSRs8j00z+AJnOsrEpBl9xLl/F32+JNYpLVQiKaMaCqWAA2+kpIvlZxGiMsbHElfojf3f7pISlKoMDL9NHgSTROvH5Vbujn1UYX146VYLpe1JxCZ5iMrLULYp1/yHYur6kbDEZrm7KQWVMPLmdbiixg+j+7OjWKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cRBNeM1Nj3xLGg7kSKptMOLIMq2MSzcL+Jl3pFJs6B0=; b=ior2IL7EC94g3fCLr/ieHC7XWXmcS4zxFSn+Q4p6rIEQ2QO9AiHXz8b7JsSA8RgMnsbluOW1KjFDP80DaLVmKcuN2IbgywuM7HyquoLeePDbN4hwVuCrsyDikD+KFHpsY1dOj8axh0PFRdmKIjPtGJNZd9XU6TeVLlQmCVN/iF5NMw2xzXNU7fgGxra0F+hzvVzi7shsGjEeYRkN9LeibDPMleKw8j0Zi3ZRl2grBF0zwt01tnyS7mRD60sCjpg+9Lcln9jwNfx5Dl84uJdkOUmog6ixgl9Dq3RwjztasotZlNrThyKBr+jt+WsR1ymrbIjmsBy2X74UsNZv3v9jng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cRBNeM1Nj3xLGg7kSKptMOLIMq2MSzcL+Jl3pFJs6B0=; b=AZXZzyYoDAPWZKYvexipL0GS+eMJaHg0VuuNbTSU7w0Jwgxc0lC3pkEYdDZVc6IQYRxRyDRGyIaDZDsn+/n24EtbhVs79YuNY/NdzGdcS+0NR2NnpGcowsGcPm7zNEEYFaqQjlBM1EoW5HQU0i9d4t2L1TxoCa9AdzuW1i1IE9y8DyCrToOS+vaOYULta2UzWZyKaoYae2stE/aDxoCjuKiyvxD5C14b0p4wVtkM7YB5EjL1fFzi9c4oD5NaiHCEi3chtGl/yQnqgJ4cYWfQu1nOu3zWEl2S9uYaj5T5EIYHS42VyiUuGpNZEK83xnRmJvuFGAFjqlTBeYfQeA424g== Received: from DM6NAM11FT039.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::36) by DM6NAM11HT050.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::390) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Sat, 15 Feb 2020 18:11:42 +0000 Received: from DM5PR07MB3067.namprd07.prod.outlook.com (10.13.172.60) by DM6NAM11FT039.mail.protection.outlook.com (10.13.172.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22 via Frontend Transport; Sat, 15 Feb 2020 18:11:42 +0000 Received: from DM5PR07MB3067.namprd07.prod.outlook.com ([fe80::1133:bcac:caf1:d588]) by DM5PR07MB3067.namprd07.prod.outlook.com ([fe80::1133:bcac:caf1:d588%3]) with mapi id 15.20.2729.025; Sat, 15 Feb 2020 18:11:42 +0000 To: Rowan Tommins , PHP Internals Thread-Topic: [PHP-DEV] Allow null variables to be decremented Thread-Index: AQHV5CeQ4FMLKsuQ5kOtI9z2r984FqgcirZO Date: Sat, 15 Feb 2020 18:11:41 +0000 Message-ID: References: <16481aca-93f4-43f5-5ec2-413d19ade318@gmail.com> In-Reply-To: <16481aca-93f4-43f5-5ec2-413d19ade318@gmail.com> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:F9933BE363F88B6A892F1BCCE884ABD5C1766CD1E4B9F42592E085398B63F434;UpperCasedChecksum:BEB6F1364ABB37A6F3B0C7A40F632A30E4DB3761C555AD7F9CD4E03E3BE039D9;SizeAsReceived:6928;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [HVNrC3YuvSFl/lZTNuND1UuKfH+k5Bwx] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: c198f38d-de35-408f-1bce-08d7b2428251 x-ms-traffictypediagnostic: DM6NAM11HT050: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F91Aor2I2RpiGLps2gJq8LYtHB8+Qwils8r21KsALWQMpCLQ0Cujm5aI8F4UlFDV/D3vdghromamArtgmIayTvcrL3B4xcGHroy4Ost0LquvT46YqEAX8jfnJDh3Aqs+i6zs4ThTuOFuRqYdMqiphTkIchWQNmQvqvbKDnu2CHvbjtgqjIrKJWIAYFx7Hzph x-ms-exchange-antispam-messagedata: VfWyilWsOfYr1nZ8a0Of94zuKntHIMtDVfLS3OmWVxyr8ToegEXFEfjUr4zmYC9Se+HATG9ysdwyMxWBMANrTNsgEttzPI2ngzJqkj0jHG+VbSn7SZD2T2qBoCh7Bk34zw1FoXGs/AWAwbiEtz139g== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: c198f38d-de35-408f-1bce-08d7b2428251 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2020 18:11:41.9114 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT050 Subject: Re: [PHP-DEV] Allow null variables to be decremented From: tysonandre775@hotmail.com (tyson andre) My opinion is that it'd be more consistent for `--` to work like `-=3D 1` (= e.g. become `-1`).=0A= It might break some code, but that code was probably incorrect.=0A= =0A= Out of scope of the proposed RFC, but this reminds me of a similar issue:= =0A= Currently, the `++` and `--` operators do nothing to arrays or objects,=0A= not even emitting a notice or changing the value.=0A= I see that `++` on typed properties/references can already throw a TypeErro= r for integer overflow,=0A= so it might make sense to also start throwing a TypeError for `++` on objec= ts (without numeric operation handlers) and arrays.=0A= =0A= I'd thought earlier that emitting a notice instead of throwing a TypeError = for arrays/objects might negatively limit the optimizations opcache can do= =0A= because error handlers can have side effects.=0A= But it looks like I'd just have to allow inferring that MAY_BE_OBJECT and M= AY_BE_ARRAY=0A= could have side effects for the INC/DEC opcodes in `may_have_side_effects()= ` in ext/opcache/Optimizer/dce.c.=0A= =0A= (If your RFC ends up emitting warnings/notices, it would need to check for = MAY_BE_NULL|MAY_BE_UNDEF in dce.c, I think.)=0A= =0A= Would there be any interest in emitting a warning or deprecation warning fo= r objects/arrays starting in php 8.0?=0A= =0A= - Tyson=