Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35868 invoked from network); 31 Jan 2017 20:47:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2017 20:47:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.50 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.215.50 mail-lf0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:35109] helo=mail-lf0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/6B-51557-BF7F0985 for ; Tue, 31 Jan 2017 15:47:55 -0500 Received: by mail-lf0-f50.google.com with SMTP id n124so217544663lfd.2 for ; Tue, 31 Jan 2017 12:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2mt90QzYlCi8fDrmlePhiAom5hGM2TxyHozI5Y2JN2I=; b=P7nDoxEK5o4fC4T5l4rGU1ubZGHdu0CwF1++ZrvYFpHQQ/LCv6GtCG/wXnUDDuZoTO eJsjLwb5dWEk5cp+W9cWiIAPmqYpE0fdH1bGeFNycp4GQUjyZU4YWXiUktSTtKxKJ9yD tRTF82vp5F9kRpOel/5jU77nHG5WI+Lsn252Ycxw168L3A6ZbHv9zXR8efgdNKMp44qE I1CS6xv6VCULbihi1TE4OgNDn17ZQx5jlYFDtIcnyazePoJuwHEoMGb+Up8f/vN9wDET 3BzoWcPgwCUNfdqts3UcBi5xv9qjidYFVry8dAZdrQOciStBSsUkyWS2osy7qMabZGS4 Aq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2mt90QzYlCi8fDrmlePhiAom5hGM2TxyHozI5Y2JN2I=; b=Y1y/1fVaceLPjN1nJO8Tt1xpe7JLsD+/SSoRARWMoCCq1SPP1lI27Z6SfGUw34q+s8 rwPIU+ZuQjvFWTcmtZgaOeFPZwyrl4OMcvU/0QyntYycZNTS4Rp6spMJlaMqi8s6iT8U 7NbkyMHPR1IuKYweAqUWooQZmA0PnzE3LSc2KGEAzJdi+YIxTPr5b3DRSK8b1Aq3o43V YrcMfG7woCWggLUZ7DGOVvMpbcfMYkcVP1xEzpoKTMp6GlnW+HxL13keK5pXs+YfZTMu h2YHEoIa/RwWsoJ+JBw++GW0KToelhKXkrQIj1eMtpLv2puRaVgJOuMFG61zyawlx4ny d/Rw== X-Gm-Message-State: AIkVDXIWSVYBNwoAdy9Hxp5cN10VniHUnxWGAPeiUdjWSmReM1CgyeKgehbmx1850+yz2E3AF7apGbognpOXcA== X-Received: by 10.25.28.199 with SMTP id c190mr9709249lfc.173.1485895672441; Tue, 31 Jan 2017 12:47:52 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.25.151.139 with HTTP; Tue, 31 Jan 2017 12:47:52 -0800 (PST) In-Reply-To: References: Date: Tue, 31 Jan 2017 13:47:52 -0700 X-Google-Sender-Auth: EfEAEJ1lW5YpDL-_UKf-LeC132Y Message-ID: To: "guilhermeblanco@gmail.com" Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] PHP's support to contravariance and covariance From: levim@php.net (Levi Morrison) > Is there anything else that I am missing? Sadly, yes. Consider the following snippet: class A { function method(): B; } class B extends A { function method(): C; } class C extends B {} When checking that B::method satisfies the requirements of A::method it must know if C extends B. At the time we check if B::method satisfies A::method, C will *not* yet be in the symbol table. You need to adjust the passes over the code to register symbols and their declared relationships, and then in a separate pass validate them. After that if the class isn't found then you trigger an autoload. It's doable, it just hasn't been done.