note 104842 added to language.constants.predefined

From: Date: Sun, 10 Jul 2011 19:33:40 +0000
Subject: note 104842 added to language.constants.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-181407@lists.php.net to get a copy of this message
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); ---- Server IP: 69.147.83.197 Probable Submitter: 50.36.53.107 ---- Manual Page -- http://www.php.net/manual/en/language.constants.predefined.php Edit -- https://master.php.net/note/edit/104842 Del: integrated -- https://master.php.net/note/delete/104842/integrated Del: useless -- https://master.php.net/note/delete/104842/useless Del: bad code -- https://master.php.net/note/delete/104842/bad+code Del: spam -- https://master.php.net/note/delete/104842/spam Del: non-english -- https://master.php.net/note/delete/104842/non-english Del: in docs -- https://master.php.net/note/delete/104842/in+docs Del: other reasons-- https://master.php.net/note/delete/104842 Reject -- https://master.php.net/note/reject/104842 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181407) next »