Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91294 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7502 invoked from network); 18 Feb 2016 22:45:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2016 22:45:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.142 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 207.46.100.142 mail-by2on0142.outbound.protection.outlook.com Received: from [207.46.100.142] ([207.46.100.142:62496] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/E2-27267-C8946C65 for ; Thu, 18 Feb 2016 17:45:33 -0500 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=zVc3f7oTCYdks5Nwls5yvpOTrJWqhCKnfyiFFi8pVm0=; b=c0CIx4ZSMEmuzlG8JEtB7Y6lKNdXz9LtsNYoWOcAhNCTD7iyhPYDn0FVjgU+VinFGfWnb8gXO0i1owwfvp4wQDK47e37i4ldU5CygWe+0zntF8CyEwnq73Na/p2d8GVUjL08OqXTrkP5Bd3jAuNlfeaAl7H7Zc1IzwF+STDlIJk= Received: from BY2PR02MB298.namprd02.prod.outlook.com (10.141.140.21) by BY2PR02MB297.namprd02.prod.outlook.com (10.141.140.17) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 18 Feb 2016 22:45:29 +0000 Received: from BY2PR02MB298.namprd02.prod.outlook.com ([10.141.140.21]) by BY2PR02MB298.namprd02.prod.outlook.com ([10.141.140.21]) with mapi id 15.01.0409.017; Thu, 18 Feb 2016 22:45:29 +0000 To: Stanislav Malyshev CC: Nikita Popov , PHP internals Thread-Topic: [PHP-DEV] [RFC] Deprecations for PHP 7.1 Thread-Index: AQHRaknF+yaXUytXzkClLtZqVI+hXp8yVa0AgAAR4OM= Date: Thu, 18 Feb 2016 22:45:28 +0000 Message-ID: <97CC6432-564B-4E28-B2DE-9C496FF1984D@zend.com> References: ,<56C63A8A.3030809@gmail.com> In-Reply-To: <56C63A8A.3030809@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [84.228.43.66] x-microsoft-exchange-diagnostics: 1;BY2PR02MB297;5:63o9jjjs9y7lkg9eLtbeaboITJN3UbH1yeyk32VjwW6VCY6rP+icru6c8LWXHEKc1An8yL7tshBzrCj463HH3SnxeI2ZIsX8mvSjCect2WamXcypzY1S5sjgbfd4W9dloSY/g/i+tC/8HBFosMRvJw==;24:s83jy4mKnX0s4lNBPZLRq1RS+96aXMdtQS9U6yWsgfJteevAZg4ifJlhWbT0B2jNl/I9c4wGq9JgLWjxpEyjpky4bkQQBp9e5dmlclNlzM4= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB297; x-ms-office365-filtering-correlation-id: 3ff54b96-f456-45c4-cecf-08d338b53367 x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:BY2PR02MB297;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB297; x-forefront-prvs: 085634EFF4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(51444003)(52034003)(24454002)(40100003)(83716003)(122556002)(4326007)(106116001)(3660700001)(99286002)(82746002)(2906002)(87936001)(33656002)(86362001)(5004730100002)(92566002)(3280700002)(66066001)(5008740100001)(102836003)(189998001)(76176999)(19580405001)(11100500001)(10400500002)(2900100001)(1411001)(19580395003)(77096005)(54356999)(110136002)(36756003)(3846002)(586003)(15975445007)(6116002)(1220700001)(1096002)(50986999)(5002640100001)(5001960100002)(2950100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR02MB297;H:BY2PR02MB298.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2016 22:45:28.3924 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB297 Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 7.1 From: zeev@zend.com (Zeev Suraski) > On 18 =E1=F4=E1=F8=D7 2016, at 23:42, Stanislav Malyshev wrote: >=20 > Hi! >=20 >> I've created a bulk-deprecation RFC for PHP 7.1: >> https://wiki.php.net/rfc/deprecations_php_7_1 >=20 > I like dropping php_errormsg. Last time I tried to make error > suppression work more efficiently this was a major problematic thing > AFAIR, and in general using magic variables that pop out of nowhere is > not a good thing. I think we need to try and get an idea for the popularity of it before depr= ecating it, as well as get an idea for what kind of performance benefits it= would bring (price/performance for making this change). > For __autoload I guess since it's incompatible with superior SPL > mechanism it has to go too. Agreed. > I'm not sure about create_function() - while it is old, I don't see why > we should break working code using it just because better option is > available. There's that, and there's the fact closures don't give you the same functio= nality - as Andrea pointed out. I think deprecating it and forcing people = to rewrite their code differently (either with eval or with closures) doesn= 't make a whole lot of sense when create_function() works perfectly well. = In terms of security risks, if you use it like you use closures I don't thi= nk it's any riskier. If you need eval() for programmatically creating func= tions - it would obviously be at the exact same risk levels. So we're left= with marginal performance gains - as practically speaking you don't typica= lly create thousands of functions dynamically in a given request. If you d= o, chances are you've already migrated to closures. >=20 > With rand functions, I don't think we need to touch them. For some > applications, low-key randomness is just fine - if you need to shuffle > array of 20 elements or randomize unit test to ensure you're not testing > same value all the time, low-quality randomness is completely fine. For > other applications, there are superior solutions and everybody who needs > them already uses them, but again I see no value in removing those > functions. It would only cause more breakage and make adoption of new > versions (already horrible) even slower. I think the obvious option here is to make rand() and srand() aliases to ra= nd_mt() and srand_mt(), unless I'm missing something very basic, unless I'm= missing something very basic here..? I see zero reason to deprecate them = and break so much code when we can simply 'upgrade' them at zero cost to bo= th us and users. I think that this is something we should try to do in general, by the way. = Deprecating is easy, upgrading is not - and we should strive to minimize c= ode breaks as much as possible. If we can reimplement an old functionality= in a new and better and seamlessly provide a painless upgrade experience w= e should always prefer it to forcing the users to edit their code. Zeev