Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103643 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 18091 invoked from network); 27 Dec 2018 21:17:50 -0000 Received: from unknown (HELO mail-lj1-f171.google.com) (209.85.208.171) by pb1.pair.com with SMTP; 27 Dec 2018 21:17:50 -0000 Received: by mail-lj1-f171.google.com with SMTP id t18-v6so16836023ljd.4 for ; Thu, 27 Dec 2018 09:49:01 -0800 (PST) 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=nHZHYhseFpAElRCLGuGK744cZ27Vqp5nEISK+/5mUUw=; b=p2jB8Mr4XFCWfgupX/eH3+l0vPPjScwsff+Tk3tlz6fCxVwRQeGwJuxpKRiH0it+CF ZsZiNR+WUwMkvsRbiWLbfRz2rE2lTYaPJWNJf88l+b+LW14RyWicZBhjQfFB3COvv7W1 y/KwIpQWkGeChMy9zSj2JzzRRPFsMXgcZgQxXf3pImsXr9PHn2eiUHwZddqDqrKfvfIE DEP8CruwpSQgXvOWKuQoDttsgOSO7sdEaTKwGLWQLeVAbiR7dkp/c7/MandPkM1j0Iqo dAOgmr32DY3tGPYfmxk/JhEAS+aktk0ZqE+p6tjEOzmoqCa7IJxoM6HLVn/gsItjBcsS XoxQ== X-Gm-Message-State: AJcUukdCVqwSMOQCiYJNkk6p7ViqIVDXajjDG9Gu7DPmu+GiyJpXavJ9 OigdOW3587OCQZ/ksJkFUBS6EKFJT0ZaQm+1UO8= X-Google-Smtp-Source: ALg8bN4etcGrGfM/1SgylHJ31pPe3reWVh52tpFDzaDPAcHMF89yk8l8W4bBFaee/F9W/eWUAwd4FTK2iSFcrl/Ulnk= X-Received: by 2002:a2e:5c07:: with SMTP id q7-v6mr15163423ljb.119.1545932940478; Thu, 27 Dec 2018 09:49:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 27 Dec 2018 10:48:44 -0700 Message-ID: To: Dmitry Stogov Cc: internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][Vote] Covariant Returns and Contravariant Parameters From: levim@php.net (Levi Morrison) > 2. But this test misses warning > > > $q = 1; > if ($q) { > class C {} > class D {} > } > > class A { > function bar(C $c) {} > } > class B extends A { > function bar(D $D) { > echo "ok\n"; > } > } > ?> The code detects this as an error but intentionally does not report it because in other cases a warning is already issued and I did not want to re-issue the warning again. I'll dig into this more to see why it is not issued the first time in this case. However, this should *remain* a warning to be consistent with existing code. When a class extends another non-abstract class and there isn't an interface involved then it's only a warning. We should fix this in PHP 8.0 for all cases.