Bug #74964 [Opn->Nab]: 'object' is not reserved at linting time
| From: | dams@php.net | Date: | Wed, 02 Aug 2017 15:35:44 +0000 |
| Subject: | Bug #74964 [Opn->Nab]: 'object' is not reserved at linting time | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210456@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74964&edit=1
ID: 74964
Updated by: dams@php.net
Reported by: dams@php.net
Summary: 'object' is not reserved at linting time
-Status: Open
+Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: Any
PHP Version: 7.2.0beta1
Block user comment: N
Private report: N
New Comment:
Yes, you're right.
Previous Comments:
------------------------------------------------------------------------
[2017-07-24 22:21:35] michal dot brzuchalski at gmail dot com
Lint stops when FatalError occurred, maybe that's why your original test script is only showing
error on 'class int' ?!
------------------------------------------------------------------------
[2017-07-24 22:17:40] michal dot brzuchalski at gmail dot com
I did checkout PHP-7.2 branch and the expected warning seems working properly, here's the
listing:
Test script:
---------------
<?php
//class int {}
class object {}
?>
Actual result:
---------------
Fatal error: Cannot use 'object' as class name as it is reserved in bug74964.php on line 5
Errors parsing bug74964.php
------------------------------------------------------------------------
[2017-07-21 14:04:16] dams@php.net
Description:
------------
it is possible to lint PHP script, and be warned about usage of 'int' or 'float'
but not 'object'.
with 'class int', php -l yields :
Cannot use 'int' as class name as it is reserved
with 'class object', php -l yields :
No syntax errors detected
Test script:
---------------
<?php
class int {}
class object {}
?>
Expected result:
----------------
Consistent error message with 'int' at linting time :
Cannot use 'object' as class name as it is reserved
Actual result:
--------------
No syntax errors detected
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74964&edit=1