|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-07-21 14:04 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
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