php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65556 Wrong error thrown
Submitted: 2013-08-26 08:18 UTC Modified: 2013-08-26 08:47 UTC
From: ante dot drnasin at wirecard dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.5.3 OS: Win7 Pro x64
Private report: No CVE-ID: None
 [2013-08-26 08:18 UTC] ante dot drnasin at wirecard dot com
Description:
------------
Just a small issue.

When (ab)using "return empty(null);"

you get T_PAAMAYIM_NEKUDOTAYIM error (unexpected ")" expecting "::") which is not true...

is it per design or a bug?


Test script:
---------------
function test() {
   return empty(null);
}

Expected result:
----------------
Null is not a valid value for "empty"

Actual result:
--------------
T_PAAMAYIM_NEKUDOTAYIM error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-26 08:45 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2013-08-26 08:45 UTC] johannes@php.net
The parser looks for something starting with a $ sign (to check for an variable, property, array offset etc.) or some literal followed by :: in order to check for static properties, it doesn't check whether the literal is a valid class name at that stage and null is no conflicting parser token.
 [2013-08-26 08:47 UTC] ante dot drnasin at wirecard dot com
ok thank you for the clarification Johannes and I appologize for false bug report...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC