note 83239 added to language.constants
| From: | ian at willis dot org dot uk | Date: | Fri, 16 May 2008 10:25:59 +0000 |
| Subject: | note 83239 added to language.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139440@lists.php.net to get a copy of this message | ||
Another difference - you cannot use a constant to reference a function.
<?php
function ccc()
{
echo "CCC\n";
}
function vvv()
{
echo "VVV\n";
}
define('cfunc', 'ccc');
$vfunc = 'vvv';
$vfunc(); // Works
cfunc(); // Fails
?>
Displays:
VVV
Fatal error: Call to undefined function cfunc() in /tmp/test.php on line 17
----
Server IP: 217.174.223.124
Probable Submitter: 57.67.164.37
----
Manual Page -- http://www.php.net/manual/en/language.constants.php
Edit -- https://master.php.net/note/edit/83239
Del: integrated -- https://master.php.net/note/delete/83239/integrated
Del: useless -- https://master.php.net/note/delete/83239/useless
Del: bad code -- https://master.php.net/note/delete/83239/bad+code
Del: spam -- https://master.php.net/note/delete/83239/spam
Del: non-english -- https://master.php.net/note/delete/83239/non-english
Del: in docs -- https://master.php.net/note/delete/83239/in+docs
Del: other reasons-- https://master.php.net/note/delete/83239
Reject -- https://master.php.net/note/reject/83239
Search -- https://master.php.net/manage/user-notes.php