php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #61021 chaging keyword 'empty' to 'isempty'
Submitted: 2012-02-09 01:01 UTC Modified: 2012-02-09 01:31 UTC
From: milevyo at gmail dot com Assigned:
Status: Wont fix Package: PHP options/info functions
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
44 - 14 = ?
Subscribe to this entry?

 
 [2012-02-09 01:01 UTC] milevyo at gmail dot com
Description:
------------
if (empty($var)){
   ...
}

this has an impression that we are trying freeing up $var and making it 'NULL'
it sound like 'DoEmpty()' or 'SetEmpty()'

but what this function realy is: 
isEmpty()

the script should looks like this:
if(isempty($var)){
   ...
}
because IMHO 'do','set' and 'let' are optional prefixes, which let you understand that this function is an order (a command)
but not the prefix 'is' which is if we can say a test prefix.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-09 01:31 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2012-02-09 01:31 UTC] aharvey@php.net
Given the massive backward compatibility break this would entail for people using 
empty(), not to mention the many hits on Koders for PHP code that has declared a 
function called isempty(), I don't think there's any feasible way this could be 
done.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 16:01:30 2019 UTC