Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102841 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75354 invoked from network); 16 Jul 2018 11:14:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2018 11:14:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=mitke013@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mitke013@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.53 as permitted sender) X-PHP-List-Original-Sender: mitke013@gmail.com X-Host-Fingerprint: 209.85.218.53 mail-oi0-f53.google.com Received: from [209.85.218.53] ([209.85.218.53:43823] helo=mail-oi0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/38-39793-61E7C4B5 for ; Mon, 16 Jul 2018 07:14:31 -0400 Received: by mail-oi0-f53.google.com with SMTP id b15-v6so73940827oib.10 for ; Mon, 16 Jul 2018 04:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5CIz1YrN7lOlYN9Xej79rG+pjPaZnaJpHCaz5ajSdks=; b=RLf0qfGTfVQdzA4W0uxh5dmu7S29d5oo+/f4NzDKoHfg6kgsRMptJKvh+pe+oS653P ui5VZ6kPERpIcU6qLNZ5XxLjg2SNKWo5BSPnorxbCXCiD18ev0/YqN/xjLiywQQQnO+O Wy4KwTJk467+9+Goh00tOw+ijgEHTb3OAGgwLqcr66sEOVArwMrOeVptEEFlBTO67W9H KucOzaKo7axV1NarHZFUj6lfqWC7MJEkQ6OBhBy7CkkZwUOt8wDhT2ifoHTa7G3cFHpo uQ/ugfyaJ7y/8+q5rjLfTey9PCt5A/OkX3Ze97Gb4vaMScMX+bcu8dDfsWUurZAjXRtC H6Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5CIz1YrN7lOlYN9Xej79rG+pjPaZnaJpHCaz5ajSdks=; b=Uw7YLU8NaiF6+Sn2O4GzgfRyasB9iiCI0u/GPRdLeyPmMGl34hqssyTp0G1CsExTln rgtoXRSvWrmLcloqT9jMxI+SbxEEiu1JLq2LmqVveUOg5BEIT1LhuRTCVMaUWyftf4zU 44lW9xdmcin4jdLjawGkzEa1K9s8R+2g6EozcQ3lVrv32oZydoLQGYU1c8CF7oPc5MM7 Rxlglr9px8nyenaF6JKZAICIUaeJDzy7m3qWICwaVc0/x1ElOAzLY4rlPw//a1F3TALz XPBko5TrpbeMgqu+GW5D5TtJqa0pYa0HyLhQt3IXY8vFNIqA2Hur3caMcsc9It2znwmI Kheg== X-Gm-Message-State: AOUpUlESuXBms2tiK+as4fXfIT0gL1EaGqj/ICT2vSwyitHLygIwr4Hk 5PsDoSmPSdGTFCxTxTEcpFEx5EGtvNf15UjehYE= X-Google-Smtp-Source: AAOMgpfWEsx+Qv66d60MkD3AlY85WoUGF7jLu6UpbRMWhF44qr0k1EWBjunqNTR1seSxXX2H4MA/c1Nk2/66qquOLyw= X-Received: by 2002:aca:69d0:: with SMTP id e199-v6mr16778606oic.286.1531739668201; Mon, 16 Jul 2018 04:14:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 16 Jul 2018 13:14:16 +0200 Message-ID: To: arvids.godjuks@gmail.com Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000cfc5df05711bee65" Subject: Re: [PHP-DEV] [RFC] Optional typehint check for parameters From: mitke013@gmail.com (Zeljko Mitic) --000000000000cfc5df05711bee65 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 16, 2018 at 1:06 PM Arvids Godjuks wrote: > =D0=BF=D0=BD, 16 =D0=B8=D1=8E=D0=BB. 2018 =D0=B3. =D0=B2 13:56, Zeljko Mi= tic : > >> I tried to, but I honestly can't see the problem. No decent programmer >> makes error by sending wrong type of parameter and this feature is 100% >> optional. I know for sure that even in my dev computer, I would use this >> feature, and probably most programmers aware of the issue. >> >> Maybe simpler example: if I send a string to above function, the only >> difference is that PHP would start executing inner code. But an inner li= ne >> like $user->getEmail() would still throw fatal error, still very easy to >> spot. >> >> But again, I really don't see that happening and I am not an expert. And >> I still never make errors like that, not even when I was learning php. A= nd >> if dev computer keeps checking type (default), it is very easy to spot a >> big mistake like that. >> >> Given this is open discussion, I would like to see where I was wrong. >> >> Btw, you were not harsh at all. >> > > Basically, you went wrong when you proposed a switch that controlls > language behavior. To add to that - a switch that probably is not > controllable by code that is running. > > Long story short in a time of php 5.3 - 5.6 it was collectively agreed > that switches that control language execution are evil, are hard to > maintain and having language behave differently due to hosting enforcing > one or the other setting and you as a user having no way to control that = is > just bad. Since then, the most evil switches were purged with extreme > pregidece and trying to introduce anything even remotly close to that is = a > suicide mission :) > > P.S. RIP magic_quotes, register_globals, short_tags and some other > articats of old. May you never be disturbed again. > > > -- > Arv=C4=ABds Godjuks > > +371 26 851 664 > arvids.godjuks@gmail.com > Skype: psihius > Telegram: @psihius https://t.me/psihius > Ok, I see your point now. Bit isn't opcache.validate exactly the opposite of that? When user deploys the code, he would not see changes before fpm is restarted. Or worse; if opcache didn't cache some file because it was not called before, more problems would happen. But please, do keep in mind that I would like to have this feature as optional. --000000000000cfc5df05711bee65--