Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84583 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18612 invoked from network); 11 Mar 2015 21:44:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 21:44:19 -0000 Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:36211] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/93-32765-F27B0055 for ; Wed, 11 Mar 2015 16:44:16 -0500 Received: by lbiz11 with SMTP id z11so11964432lbi.3 for ; Wed, 11 Mar 2015 14:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=iE2CMsc8RRGtl06yam9q4nytGYcH2SzATV4qOVpsd5s=; b=anRAEzWkw4N+/99BFRtqg1tvJXuLYPYAfC7uK7wzBbUYAZ3xfZtzoyaktxw1T+bp9a u5QT7QfM5LPpZinSOIaeac1QPceTOBbtIDNiu81chQk3PoxddWCrdaabw9Qr4M9AzS45 CFDHv6VsR+NVvshtdohlTCaz33GM/r7sNhDFk0952tUWemYWFeSnzlUGV48ZneK1ubMn KVfSDiuKa3RpozEc41accOqVorbMeHpRgmdClJbl20YllbqysZCH2DQWbkilGX5lRolG 7+HrrK69Fyg0umVjriqaf79BfcYUsdJATqQyi6d61lYEM1Th6S6C7gtMDI0xh2o2AQOW nxzw== X-Received: by 10.112.173.133 with SMTP id bk5mr36199654lbc.94.1426110250772; Wed, 11 Mar 2015 14:44:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.118.169 with HTTP; Wed, 11 Mar 2015 14:43:50 -0700 (PDT) Reply-To: marcio3w@gmail.com In-Reply-To: <55000A88.1030909@lsces.co.uk> References: <54FF8CED.5030701@gmail.com> <54FFC96D.6090004@gmail.com> <1579682575.9673.1426064704052.JavaMail.open-xchange@app06.ox.hosteurope.de> <55000A88.1030909@lsces.co.uk> Date: Wed, 11 Mar 2015 18:43:50 -0300 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c23816e8714905110a2a8f Subject: Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count From: marcio.web2@gmail.com (Marcio Almada) --001a11c23816e8714905110a2a8f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2015-03-11 6:27 GMT-03:00 Lester Caine : > On 11/03/15 09:05, wp12173047-156224 wp12173047-156224 wrote: > >>> BTW, the current PHP silent behavior should be considered even more > >>> > > confusing otherwise we > >>> > > wouldn't have these measurements: > >>> > > > >>> > > > https://wiki.php.net/rfc/strict_argcount#bc_breaks_on_the_real_world > >> > > >> > I'm not sure how these prove current behavior is "confusing". Yes, > there > >> > are bugs in the code, and I'm sure this feature will expose some of > >> > those (previously harmless) bugs. At cost of the BC break. And don't > >> > think a handful of libraries represent the vast universe of PHP code= , > >> > most of which we can't even see because it's not published anywhere. > > What do you mean here? > > > > Again, introducing a warning isn't a real BC-break and as you says ther= e > are > > bugs it helps nobody ignoring them. If you think so you can do that wit= h > all of > > your own bugs by ignoring warnings/notices. > > I must say I was a little confused when I first saw this given the > number of errors I got when addressing the E_STRICT ones on existing > code. One ended up creating multiple functions with different arguments > to get a clean set of code, but I had perhaps not even realised that > adding extra arguments was not flagged. A lot of people don't know it too, and they are shooting themselves on the foot without realizing it because PHP is currently silent about it. > In practice my IDE setup is > flagging warnings where variables are not used, and it seems that > perhaps I'm in a 'safe place' because of the whole package rather than a > particular 'bug' in PHP. > > Your IDE is a tool you are using to be safe from the current PHP misleading behavior. It's fine to use tooling, but that's a basic feature that shouldn't require special tooling. > Most of the examples being shown are examples of simple bad programming > practice that needs fixing anyway, and I would expect a proper code > review to have picked them up, so don't see that adding the check in PHP > is essential. It would however be a useful addition but in the E_STRICT > category ... not that I want to maintain that, but being able to ignore > those errors until such time as it is appropriate to fix them. I think this is a valid argument to keep the E_STRICT error level option for the secondary voting. That's a very useful information, thanks :) > The > poorly checked code is the problem rather than PHP here, and I'm with > Stas that it's probably being a bit heavy handed at this point in the > PHP7 process. Actually I would be rather annoyed if the problems > demonstrated have not already been cleaned up already? The examples are not "poorly checked" code, they were retrieved on widely used packages we all rely, directly or indirectly. Both code and tests used in the measurements are maintained by experienced people and yet the problems found a way to lurk (it's not a fault on the maintainers side). I'd say it's enough information to improve the language, not to require that people should manually check their code more or use tool A or B. > A tool to > identify problems and get them cleaned before the main test is switched > on helps everybody? > -- > Lester Caine - G8HFL > ----------------------------- > Contact - http://lsces.co.uk/wiki/?page=3Dcontact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk > Rainbow Digital Media - http://rainbowdigitalmedia.co.uk > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Thanks, M=C3=A1rcio --001a11c23816e8714905110a2a8f--