Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99180 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26238 invoked from network); 25 May 2017 16:38:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2017 16:38:13 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.45 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.45 mail-oi0-f45.google.com Received: from [209.85.218.45] ([209.85.218.45:34722] helo=mail-oi0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/2A-10292-37807295 for ; Thu, 25 May 2017 12:38:13 -0400 Received: by mail-oi0-f45.google.com with SMTP id b204so286915337oii.1 for ; Thu, 25 May 2017 09:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bYU0KTWimK44IryImSvSdbp3uY2adlbQbkkeO2wYNbQ=; b=s0uoqiXpDS1sQ5xeg4ODFl/EcEwnri3fYfkOEWqM22c/YuTPQLw1pyujx49SBlZkNo OKj3+/CCImlq/l9BPcBL4CrxPy7CexnOewyoQ5nYrDEW9hp/GHDOQm79cejM2XQhd5Bz XVMrC3RAtkYSzs0lnkPZlwtA5cHrOi5gqGzjs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bYU0KTWimK44IryImSvSdbp3uY2adlbQbkkeO2wYNbQ=; b=kP9cH5d7VUNhBFafvBV11rsDTQSIw59l2VyUtzVOkri4sKChhagC13yoCC7T7sQ0Jq hChjM+qTlQRPukceDBkKLFFMxXJ9dWOh0pu6n+VzRfC5FZA3+e78tTmOeRmEfTJixxPT A+P3Ef2W12uF02Yph+B+B78r5v9MuX2lXUglkYudB2+6C8ep3K1EJ5sMp2Twf5+fPzRg 6k/Zfm7nzaPYUiJsEkIm7hHs+Zbte6x6VJaJ3kZX0tY5hN753N4HVdqkNlg/4UtVbNpi 3ZWVtPfrrZ+YORogR9IjRu9YIe1ZZZR/lxbLGchmN+WEkqozlrkf8k0u9DhLdermQw8U 1LjQ== X-Gm-Message-State: AODbwcALIOeSIokxvc9ylklo6XeAGzY2dKmqFfrQyF9hzoEehjxV6QSd GxvdSN+iqcUi9+8RQzn9hcVePfpLHpbo X-Received: by 10.202.0.4 with SMTP id 4mr19398426oia.8.1495730288904; Thu, 25 May 2017 09:38:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.110.7 with HTTP; Thu, 25 May 2017 09:38:08 -0700 (PDT) In-Reply-To: References: <269187f4-5924-a7cc-9163-40134546451f@fleshgrinder.com> Date: Thu, 25 May 2017 19:38:08 +0300 Message-ID: To: Marco Pivetta Cc: "internals@lists.php.net" , Rasmus Schultz Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Parameter type widening RFC From: narf@devilix.net (Andrey Andreev) Hi Marco, On Thu, May 25, 2017 at 6:58 PM, Marco Pivetta wrote: > On Thu, May 25, 2017 at 4:30 PM, Andrey Andreev wrote: >> >> I'm trying, but fail to find a source that says replacing stdClass >> with mixed/any/etc is ok. > > > It is OK for a subtype to handle a wider range of types than its contract, > it is not ok for the subtype to handle a smaller range of types than its > contract. > > A contract says what you "must" be able to do to satisfy it, so the > invariants hold. > Sorry, but by "source" I didn't mean somebody state it here. :) When I said I don't claim to fully understand LSP, I didn't mean "tell me what it is" - I'm familiar with it. What I don't understand is how do we get from this: > Wikipedia: > > an object of type T may be substituted with any object of a subtype S To this: > A single type may be substituted by any other type Cheers, Andrey.