Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102839 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73123 invoked from network); 16 Jul 2018 11:06:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2018 11:06:39 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.52 as permitted sender) X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 209.85.218.52 mail-oi0-f52.google.com Received: from [209.85.218.52] ([209.85.218.52:44559] helo=mail-oi0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/C7-39793-E3C7C4B5 for ; Mon, 16 Jul 2018 07:06:39 -0400 Received: by mail-oi0-f52.google.com with SMTP id s198-v6so73963723oih.11 for ; Mon, 16 Jul 2018 04:06:38 -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=5ZSyzzG+jttppPBeDk6oayaXOYjNWkBZmokwsDnmbk8=; b=gBhaoGzADE2T68qRgLqdtNFjfzuK1CNF+SUgvPs80TvCMZXMX0JKA2aJ6VpurYIH/M RXELwelQ4pkFENzyWbNFZKNkZQdTpkAKoK8CAx8cO+JwHq7OM/cSq0+dNu/G2dNG52le fD4B64+zYCUOA51RvokAIHsKhCyjbKCQv8B6vVW9b+pEQjkz4Aeb9XkgRM0u21S76SYY SjDQZYnJHotqW5Ub4idnFQ1+fFqIPMHoIptuWrlcVqiBdGxf9BckZrcRB5hOD2807hY0 6UrWZdTpiOYNH3inaGwBngoiqsib5hySQGoYUL4FYRCem1DBZ3bcp8ysP1ze5i6fSMRc CUpw== 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=5ZSyzzG+jttppPBeDk6oayaXOYjNWkBZmokwsDnmbk8=; b=GGoZyfJAbe4OJGLSQYlRnc+V8O+dXHv3/uuW3cD3ng5dy3JRISAMP50UFsAOr+9NOr LGKeHjJ7Pvb47bUm14CXQm0EXnlDbtdLZoAtw0XTnLH20VdqDGQ1dOAdgDs/x3+YDdsA 11uONTdSiKqPZoqvr5TJzFv9H7WIE1cd8/QeKy1xC7nZo/skXtjCZJHwYivAO641Xi0A +YxtguRmLdssq4j5Bly0WMuUhlYQIxQpaBAFxE+OrzOVECpzVpmo4BDXygYt+YSGZ/3Z VYCI7XNoi7r9hkl64Df9K9e2MuXdw4Hvx3XiOsJuETgEXeshylOsLOmqtB+KGjT74yyR NLMA== X-Gm-Message-State: AOUpUlGKxNYVD9zx0vktpe3/XhqmskSMLojDYfAyts7E/QK/ZqYl/DlE 2CUwH6Mor9oFXguhDvB9K0uhXwApJT3PxHopgIg= X-Google-Smtp-Source: AAOMgpcLOCZsOQRgqNLLBYle140crybxkrOthfI+B1NqmLx1iZy/cP0mfD+GEbZIbevLHWbBMfh7/FB6msvmxU/KTcc= X-Received: by 2002:aca:120e:: with SMTP id 14-v6mr16595495ois.144.1531739194978; Mon, 16 Jul 2018 04:06:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 16 Jul 2018 14:06:08 +0300 Message-ID: To: mitke013@gmail.com Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000009af79305711bd223" Subject: Re: [PHP-DEV] [RFC] Optional typehint check for parameters From: arvids.godjuks@gmail.com (Arvids Godjuks) --0000000000009af79305711bd223 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =D0=BF=D0=BD, 16 =D0=B8=D1=8E=D0=BB. 2018 =D0=B3. =D0=B2 13:56, Zeljko Miti= c : > 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 lin= e > 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. And = 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. --=20 Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius --0000000000009af79305711bd223--