|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2009-03-02 11:52 UTC] vivekanandan8 at yahoo dot com
 Description:
------------
When  setting configuration variable using ini_set for displaying errors does not work  when  we set in  line before the error when we are using include or require.but it works when we set in main page. 
Reproduce code:
---------------
//This is includeFile.php
<?
ini_set("display_errors",1); 
print "This is includefile.php
   
?>
//This is test.php
<? ini_set("display_errors",0);
	print "before include";
	require_once 'includefile.php'; 
?>
Expected result:
----------------
before include
Parse error: syntax error, unexpected $end in /var/www/cof1/bk/sivam/test1/includefile.php on line 5
Actual result:
--------------
before include
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Thu Oct 30 12:00:01 2025 UTC | 
You can't use ini_set('display_errors') to hide errors because your script have not reached the execution state yet.