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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ante dot drnasin at wirecard dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 15:01:28 2025 UTC