Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92573 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6165 invoked from network); 20 Apr 2016 20:08:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 20:08:17 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.173 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.223.173 mail-io0-f173.google.com Received: from [209.85.223.173] ([209.85.223.173:36341] helo=mail-io0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/76-14036-1B1E7175 for ; Wed, 20 Apr 2016 16:08:17 -0400 Received: by mail-io0-f173.google.com with SMTP id u185so64375725iod.3 for ; Wed, 20 Apr 2016 13:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=U3c3OLNm34H/6/NNPb8dJgK+hethm/x8keW6+MODWDk=; b=u4MgzQkHj1LkvxjbvH0o7npv/9RX9ngm4Lgphub7PodcMHxQmaPgnahCBZ8zZd3ylH i4+WGZFnmycWkVgcuGlk3rcEtZbscxCIOPZlUOEIKJJ4R7YILBmPdZHMlg8yR7Wscs2Y GRtO73t3tgCF0imt+dtp07zsuq/gd7Atv3hd9+5RUnS6oEqc/uD9St29FArw0oQxGAob Luspz22Kzb2LHailMb7l6wc+OOQ9VGwQWHgpptKzaTeBSZhi2MHNc1PhSEeRDt4q0QIQ Tcf6g2j65Qchu9QGwdtsJsGNq1DftgOuT/BjiVk7gAt2DOPjtculNDERNpPDmBHdCq5/ 3vaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=U3c3OLNm34H/6/NNPb8dJgK+hethm/x8keW6+MODWDk=; b=ZSPw7Lo/egALZmnPuXvOfeP+1iDZX5Tt7d0GljYNfhLo6xulgDwwqeX0Ocai+DlKJQ LVp20KEhkfZQbqrMN8IGy8KX0nyjZyLlCkDRecHgKk5COmbjf9Cotwu9W2d84dUIjTHZ zPZcCpiVZWQgLZ2Ca0tx8Ikfb4sfgLXQ6GYNwGBLpAjpsSn8miu6+YQuHWZXSoFsIs44 QgWuwS7qyuokgpCWCQS0HK6AvZR/XTww4t7D6WDbwNFGjvF4gqQFdvyUa/YooDfKH9eu 4QLlvl5WQax8IOsc7ixwvfZ9oTfH/30qnlGtslmAFP7gA7SNef2FMXBbm5svK2YXg88N m9MA== X-Gm-Message-State: AOPr4FWOo3EoGSVoQ0NYB7T9Feu0nLeFmDPuGI4QSz1ewkVLiUCHPKumXhssHQrxctChNiiIZdgct737aY1lvA== X-Received: by 10.107.148.210 with SMTP id w201mr12242631iod.63.1461182895458; Wed, 20 Apr 2016 13:08:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.85.10 with HTTP; Wed, 20 Apr 2016 13:07:56 -0700 (PDT) In-Reply-To: <5717E02C.9030505@gmail.com> References: <5717D70E.5010706@lsces.co.uk> <5717E02C.9030505@gmail.com> Date: Wed, 20 Apr 2016 16:07:56 -0400 Message-ID: To: Stanislav Malyshev Cc: internals Content-Type: multipart/alternative; boundary=001a113fd4026f90d70530f02776 Subject: Re: [PHP-DEV] Quick sanity check ... From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --001a113fd4026f90d70530f02776 Content-Type: text/plain; charset=UTF-8 The question here is how type strictness would benefit the language. I agree with you on most parts. But still... if the class was declared like this: class CancelOutdatedOrdersDTO { public int $olderThan; } Wouldn't that be solved entirely? Code would crash (through a TypeError), it would never be pushed to production and we would never have experienced this problem. PS: I just gave one example... we didn't actually loose 100k, but I had to spend an hour manually addressing the sales back to pending status. Regards, On Wed, Apr 20, 2016 at 4:01 PM, Stanislav Malyshev wrote: > Hi! > > > The outcome is easy to grasp. Because it did not crash by a TypeError > > (which would also require the file to be declared as strict), and we lost > > 100k in sales. But PHP does not need more strictness... > > In other words, somebody wrote code that is supposed to only accept ints > but does no checks. Somebody wrote tests that actually don't test > anything. Somebody signed off on code that was not properly designed or > tested to go into production. And the language is to blame. Right. > > -- > Stas Malyshev > smalyshev@gmail.com > -- Guilherme Blanco Lead Architect at E-Block --001a113fd4026f90d70530f02776--