Bug #80041 [Opn->Nab]: Multi-line namespace no longer works with PHP 8
| From: | requinix@php.net | Date: | Mon, 31 Aug 2020 18:22:34 +0000 |
| Subject: | Bug #80041 [Opn->Nab]: Multi-line namespace no longer works with PHP 8 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228826@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80041&edit=1
ID: 80041
Updated by: requinix@php.net
Reported by: w1djmartin at gmail dot com
Summary: Multi-line namespace no longer works with PHP 8
-Status: Open
+Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: Windows 10
PHP Version: 8.0.0beta2
Block user comment: N
Private report: N
New Comment:
That is correct: namespace names are now one whole unit, not multiple names with slashes in between.
https://wiki.php.net/rfc/namespaced_names_as_token
Previous Comments:
------------------------------------------------------------------------
[2020-08-31 18:20:59] w1djmartin at gmail dot com
You can easily see how the result changes at https://3v4l.org/IWbe1
------------------------------------------------------------------------
[2020-08-31 18:16:57] w1djmartin at gmail dot com
Description:
------------
Prior to PHP 8 Beta 1 splitting a namespace across multiple lines would work without error. Starting
with PHP 8 Beta 1 a namespace that is split across multiple lines results in a parse error/syntax
error.
Test script:
---------------
namespace Foo
\Bar
\Baz;
echo __NAMESPACE__;
Expected result:
----------------
The test script should output: Foo\Bar\Baz
Actual result:
--------------
The test script throws an error: Parse error: syntax error, unexpected fully qualified name
"\Bar", expecting "{"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80041&edit=1