note 83139 added to function.include
| From: | fernandoleal at drakecall dot com | Date: | Mon, 12 May 2008 17:55:45 +0000 |
| Subject: | note 83139 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139312@lists.php.net to get a copy of this message | ||
Like the manual says the includes gets all function and variable on global scope that
Includes errors so watch out if you disable display errors with @ because it also hides the included
file errors, its kind of dumb :$ hehe but sometime you miss it when you want to prevent displaying
errors.
This also applies to include_once, require and require_once.
Example
âindex.phpâ
<?php
#Shows the error âParse error: syntax error, unexpected T_VARIABLE inâ
include(test.php);
#Doesnât show the error
@include(test.php);
?>
âtest.phpâ
<?php
$parse_error
?>
----
Server IP: 69.147.83.197
Probable Submitter: 189.152.148.201
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- https://master.php.net/note/edit/83139
Del: integrated -- https://master.php.net/note/delete/83139/integrated
Del: useless -- https://master.php.net/note/delete/83139/useless
Del: bad code -- https://master.php.net/note/delete/83139/bad+code
Del: spam -- https://master.php.net/note/delete/83139/spam
Del: non-english -- https://master.php.net/note/delete/83139/non-english
Del: in docs -- https://master.php.net/note/delete/83139/in+docs
Del: other reasons-- https://master.php.net/note/delete/83139
Reject -- https://master.php.net/note/reject/83139
Search -- https://master.php.net/manage/user-notes.php