Bug #74964 [Com]: 'object' is not reserved at linting time

From: Date: Mon, 24 Jul 2017 22:21:36 +0000
Subject: Bug #74964 [Com]: 'object' is not reserved at linting time
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210304@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 Comment by: michal dot brzuchalski at gmail dot com Reported by: dams@php.net Summary: 'object' is not reserved at linting time Status: Open Type: Bug Package: Class/Object related Operating System: Any PHP Version: 7.2.0beta1 Block user comment: N Private report: N New Comment: Lint stops when FatalError occurred, maybe that's why your original test script is only showing error on 'class int' ?! Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#210304) next »