note 104842 deleted from language.constants.predefined by peehaa
| From: | peehaa@php.net | Date: | Mon, 22 May 2017 07:24:43 +0000 |
| Subject: | note 104842 deleted from language.constants.predefined by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209082@lists.php.net to get a copy of this message | ||
Note Submitter: user9 at voloreport dot com
----
Note that __FILE__ has a quirk when used inside an eval() call. It will tack on something like
"(80) : eval()'d code" (the number may change) on the end of the string at run-time.
The workaround is:
$script = php_strip_whitespace('myprogram.php');
$script = str_replace('__FILE__',"preg_replace('@\(.*\(.*$@', '',
__FILE__,1)",$script);
eval($script);