Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89124 invoked from network); 27 Jun 2016 16:29:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2016 16:29:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=k@rl.pflaesterer.de; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.3 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.3 plane.gmane.org Received: from [80.91.229.3] ([80.91.229.3:54111] helo=plane.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/58-40393-48451775 for ; Mon, 27 Jun 2016 12:29:58 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bHZPy-0003rq-VR for internals@lists.php.net; Mon, 27 Jun 2016 18:29:51 +0200 Received: from tmo-106-185.customers.d1-online.com ([80.187.106.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jun 2016 18:29:50 +0200 Received: from k by tmo-106-185.customers.d1-online.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jun 2016 18:29:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Mon, 27 Jun 2016 18:29:46 +0200 Lines: 49 Message-ID: References: <5d2a68ac-ccd8-59a9-31a8-91e40ecae12f@heigl.org> <500b1edb-ab52-da1e-5874-0fafa5dd8a7f@heigl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: tmo-106-185.customers.d1-online.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:yrszO3jbGozP7LTMZXGHq5TTBYM= Subject: Re: [PHP-DEV] Possible Bug with Interface, Constants and Inheritance From: k@rl.pflaesterer.de ((Karl =?utf-8?Q?Pfl=C3=A4sterer?=)) Bishop Bettini writes: > On Mon, Jun 27, 2016 at 11:31 AM, Andreas Heigl wrote: > >> Am 27.06.16 um 15:28 schrieb Karl Pflästerer: >> > Andreas Heigl writes: >> > >> >> Am 27.06.16 um 15:01 schrieb Karl Pflästerer: >> >>> interface I1 { const C1 = '';} >> >>> class C3 implements I1 { const C1 = 'c2';} >> >>> $c3 = new C3; >> >>> var_dump($c3::C1); >> >> >> >> According to https://3v4l.org/jIcs6 it looks like that's intended >> >> behaviour ;) >> > >> > But why does it work in the CLI if I write the code (instead of using a >> > script)? That's my question. >> >> It doesn't. At least not on my machine. This is the output I get: >> >> $ php -v >> PHP 7.1.0alpha2 (cli) (built: Jun 24 2016 13:50:28) ( NTS ) >> Copyright (c) 1997-2016 The PHP Group >> Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies >> > > Technically, this is a different version than reported. Nonetheless, on the > same version my REPL complains as well, I suspect because the original > report misspelled the INI setting ("-ddispplay_errors=On", notice the > double "p"): [...] Thanks; that explains why I didn't see the error message. > > Under normal interpretive operation, the Fatal terminates the script. But > in the case of the REPL command line, those are swallowed up and you can > keep going. Same as like: > And that explains why I was able to instantiate a broken class (with a overriden constant). So no bug but an interesting edge case. KP