Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101361 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60922 invoked from network); 18 Dec 2017 14:59:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2017 14:59:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.215.42 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.215.42 mail-lf0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:45527] helo=mail-lf0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/76-21958-9B7D73A5 for ; Mon, 18 Dec 2017 09:59:06 -0500 Received: by mail-lf0-f42.google.com with SMTP id f13so18075245lff.12 for ; Mon, 18 Dec 2017 06:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bmsaEJFSbVwhRigENAVrAz2humUQHpL8WbmEOmWjGSc=; b=JPRKNPU9gFs1UT5nRYttofjqIYFd21h7MT8MeLvwHz/ldVqiqRdd4oAsYO+ZK6elYP ciTff3dZvjkesU1nFha0dvN9En20kQQWbcVRuEn6djGzNA66hwgEAucj3ZQ2Igcm+Nl9 ageBh4Mri12yE2soc2mTNVGTeu9NjnbFS6nOK8uwn5CknnSxxoH0jqoB5VwHQwc6Kj+3 GC87A03dyC3TVBf7bWXX8fH6Eti1lH04q+fXQ6m8ais5WbRZyGwtLSj7+6WCCnBxhR2C ILsUhyfdlRPXdZJtgvy7N6imHwDUrRa6HnTFl9seacScAtMX+TMCbaKREbH0yZH8QnVk IKYQ== 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=bmsaEJFSbVwhRigENAVrAz2humUQHpL8WbmEOmWjGSc=; b=ljw35+PPIBua4QAgHdhvlv1vdNZjQq6c17mVcR6TtjMlerG3gsVD7OsfqDtDDFFG7U I05D8GrhcbfLHG8POb8/V2RTDSNbcXHpTEF+fbQIWq/DJlgNn6x/lkd5PSCAcRK4oBPV ikPmtfTnokH9jt7xaMOdmnhhwy/C63jbN20zdAQyDKu+5kf0prohy+VWQpbr3J3DZfUl 4Cj7Yxpfmkm5ARaBPv80O/kx2nRp9c3iRtsyZ81t8a0XACBmUGBHUERxI3J3s4yj5wyq oRIUtiBE4sSwalYSQj+SQxaKuUkBB3YW98Ew6RvNzV3PTD4pO6u5834dt0mPqjwJjheU wYGA== X-Gm-Message-State: AKGB3mKwQ1G91vxoG/QK/UctJTpRN8VokylOGwAE09EA8Xpek1ecL74f e2ztpLk7lsj99BdtP0fO8E4c8vM7 X-Google-Smtp-Source: ACJfBoskXNbjOyBNq/AVdhf+GrRbTlKq9nOUbuG6IwiBZAD+4McJePojwRPr/rh1JVVCqNGciEQGSQ== X-Received: by 10.46.4.13 with SMTP id 13mr13340lje.82.1513609142071; Mon, 18 Dec 2017 06:59:02 -0800 (PST) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com. [209.85.215.45]) by smtp.googlemail.com with ESMTPSA id j1sm2838852lfe.66.2017.12.18.06.59.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 06:59:01 -0800 (PST) Received: by mail-lf0-f45.google.com with SMTP id a12so18109766lfe.4 for ; Mon, 18 Dec 2017 06:59:00 -0800 (PST) X-Received: by 10.25.41.194 with SMTP id p185mr73691lfp.125.1513609140482; Mon, 18 Dec 2017 06:59:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.170.16 with HTTP; Mon, 18 Dec 2017 06:58:39 -0800 (PST) In-Reply-To: References: Date: Mon, 18 Dec 2017 15:58:39 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Levi Morrison Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Covariance, again From: andreas@dqxtech.net (Andreas Hennings) Let me address the simple example first. On 18 December 2017 at 15:45, Levi Morrison wrote: > > I believe your algorithm fails on this simple setup: > > > interface A { > function foo(): X; > } > > interface B extends A { > function foo(): Y; > } > > interface X { > function bar(): A; > } > > interface Y extends X { > function bar(): B; > } > > ?> > > If I correctly typed this from memory there is no way to order this > such that all units are defined ahead of time as needed for verifying > correctness. This means we trigger the autoloader even though the type > is defined in the same file. Even if we do some more complicated > compile-time passes we'd fail on things like this: You need to compile all classes in the file, and then do the autoloading. So maybe my description of the algorithm is too simple. However, this is not really new, and is not really a problem I would say. What about this: https://3v4l.org/5klJQ Here the interface I is declared after the class C that implements the interface. This means the autoloading for identifiers in "extends" or "implements" clauses already need to wait for the current file to be fully processed. So yes, we need to process the entire file before autoloading anything. But we already do that for inheritance. So it is nothing new.