note 55103 deleted from functions.arguments by cmb
| From: | cmb@php.net | Date: | Sun, 10 Nov 2019 12:57:16 +0000 |
| Subject: | note 55103 deleted from functions.arguments by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213016@lists.php.net to get a copy of this message | ||
Note Submitter: Angelina Bell
----
It is so easy to create a constant that the php novice might do so accidently while attempting to
call a function with no arguments. For example:
<?php
function LogoutUser(){
// destroy the session, the cookie, and the session ID
blah blah blah;
return true;
}
function SessionCheck(){
blah blah blah;
// check for session timeout
...
if ($timeout) LogoutUser; // should be LogoutUser();
}
?>
OOPS! I don't notice my typo, the SessionCheck function
doesn't work, and it takes me all afternoon to figure out why not!
<?php
LogoutUser;
print "new constant LogoutUser is " . LogoutUser;
?>