|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52040 Fatal error (undefined function) not reported when php within html tag's attr
Submitted: 2010-06-10 16:41 UTC Modified: 2010-06-11 11:03 UTC
From: michal_musial at o2 dot pl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Windows 7 Ultimate (any?)
Private report: No CVE-ID: None
 [2010-06-10 16:41 UTC] michal_musial at o2 dot pl
PHP does not print Fatal error when an undefined function is called from within a 
html tag's attribute.
Error is saved to php error log if one is specified in php.ini, but there's 
nothing being printed. Execution ends at the line preceding the line containing 
the undefined function.

Test script:
<p class="<?php echo bogus(); ?>">p2</p>

Expected result:
<p class="<br />
<b>Fatal error</b>:  Call to undefined function bogus() in 
<b>E:\_webroot\localhost\test.php</b> on line <b>3</b><br /> 

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-10 16:48 UTC] michal_musial at o2 dot pl
Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache 2.2.13.
Same problem.
 [2010-06-10 17:07 UTC]
-Status: Open +Status: Feedback
 [2010-06-10 17:07 UTC]
Can't reproduce with the VC9 build of 5.3.2 from in CLI mode.
Are you sure you have no special php.ini settings (like auto_prepend) or anything related to output buffering?

This really looks like a configuration issue at first glance.
 [2010-06-10 17:13 UTC] michal_musial at o2 dot pl
-Status: Feedback +Status: Open
 [2010-06-10 17:13 UTC] michal_musial at o2 dot pl
I'm no expert in php config, so it's entirely possible.
Have a look at my config:
 [2010-06-10 17:19 UTC]
-Status: Open +Status: Feedback
 [2010-06-10 17:19 UTC]
Please try with the php.ini-production and try to reproduce
 [2010-06-11 10:39 UTC] michal_musial at o2 dot pl
-Status: Feedback +Status: Open
 [2010-06-11 10:39 UTC] michal_musial at o2 dot pl
I can confirm that the problem does not exist when parsing the code in CLI mode on 
my current setup (PHP 5.3.2 VC6 - for apache). This points the problem to php5-
module for apache.
I am not able to check whether VC9 version is affected as from what says VC9 should not be used with apache binaries and I don't have 
 [2010-06-11 11:03 UTC] michal_musial at o2 dot pl
-Status: Open +Status: Closed
 [2010-06-11 11:03 UTC] michal_musial at o2 dot pl
I've found the problem source.
Turned out it was the browser itself stripping out the invalid line altogether 
for some reason - Chrome 6.0-dev

Testing reavealed that:
- IE8 displays the error normally in the browser (which is wrong really as it 
should be only visible in the source)
- Firefox 3.6 shows the error in the source
- Opera 10.53 shows the error in the source

I'm closing the bug.
Thanks for your help fa.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Dec 05 09:01:23 2020 UTC