Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84377 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63445 invoked from network); 6 Mar 2015 08:46:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Mar 2015 08:46:26 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.171 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 74.125.82.171 mail-we0-f171.google.com Received: from [74.125.82.171] ([74.125.82.171:38348] helo=mail-we0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/72-41399-06969F45 for ; Fri, 06 Mar 2015 03:46:24 -0500 Received: by wevk48 with SMTP id k48so11391386wev.5 for ; Fri, 06 Mar 2015 00:46:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=gAE8BX6WzNruApxPonQQv/xKX0B8FSiv++Vv3l9j/oA=; b=Ms4KJaSAuqp/x6XUYgPV7i/VXVnixTFdZG47igOX3YDEVp1AzxpIaBzubrdIvNqEgX YtI6o4FGUCZWhkc9ciiRGeC6aXeXyCcEANWwBKMIwTqF0Z0j2eVLAQhxKJKNTl+CnvWm /Or5GhTP4wyEI3Yq5ArQIB9RIionDe3xBCnErMMYDQL5K8pViu46GSLKRcLevVvhxsUK 0SLmUuoTQdbkn2KXx2vXkZfcD4YOtGcWU2K4SHAmQ9szHHeDAeGs3brcLiUNDL5rkQwt KThZiboCn5e2/Fj4XhBSEfN2zPlHqUTzTAqOOqCDUVUxXiqKYViNs2mUwVXE77rqHle4 wWnA== X-Received: by 10.194.94.164 with SMTP id dd4mr27865596wjb.56.1425631581208; Fri, 06 Mar 2015 00:46:21 -0800 (PST) Received: from lepisma.bemi (89-104-28-113.customer.bnet.at. [89.104.28.113]) by mx.google.com with ESMTPSA id b4sm1264146wic.2.2015.03.06.00.46.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Mar 2015 00:46:20 -0800 (PST) Sender: Michael Wallner Content-Type: multipart/alternative; boundary="Apple-Mail=_B73DFE83-62B2-4896-980A-86D71A88C85C" Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Fri, 6 Mar 2015 09:46:22 +0100 Cc: "internals@lists.php.net" Message-ID: <1FAFAF33-0168-4E9E-9F33-3D812C4AC281@php.net> References: To: Anthony Ferrara X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] Use behavior thoughts From: mike@php.net (Michael Wallner) --Apple-Mail=_B73DFE83-62B2-4896-980A-86D71A88C85C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii >=20 > So, I created a PR to remove this error: > https://github.com/php/php-src/pull/1149 = +1 >=20 > Note that there is no BC break here, as it's removing an error = condition today. >=20 > This results in a weird edge case (which is 100% valid, but feels = odd): >=20 > class Test {} > use Bar\Test; > var_dump(new Test); // class(Bar\Test) >=20 > That's perfectly valid, if not a bit weird. >=20 > The reverse would error mind you: >=20 > use Bar\Test; > class Test {} >=20 > Because you've already defined the symbol Test in the file. >=20 > To get around this, I've created another PR with a BC break, adding a > compile error if code comes before `use`: > https://github.com/php/php-src/pull/1150 -1, the example you gave looks totally valid. Regards, Mike --Apple-Mail=_B73DFE83-62B2-4896-980A-86D71A88C85C--