php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42770 defined() not catching class lookup miss properly
Submitted: 2007-09-26 21:33 UTC Modified: 2007-09-29 03:05 UTC
From: tautolog at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.4 OS: *
Private report: No CVE-ID: None
 [2007-09-26 21:33 UTC] tautolog at gmail dot com
Description:
------------
Hi,

It appears that defined() is not catching a class lookup miss properly, and throwing a fatal error instead.

This is happening on a customer's 5.2.4 install. It works fine on my 5.2.3 install.

I haven't actually seen it for myself, but a customer told me that he is on php 5.2.4 and that he got this error:
[Wed Sep 19 09:20:17 2007] [error] [client 85.178.73.32] PHP Fatal error: Class '.. ' not found in /var/www/html/mb5/lib-action/include/smarty/core/plugins/modifier.constant.php on line 20

And that line is:
	if (defined($string)) {

The values of $string at that point was probably this:
".. :: 1000 MB Webspace :: 100 GB Traffic :: .."

Thank you,

Ben

Reproduce code:
---------------
echo "<?php echo (int) defined('.. :: 1000 MB Webspace :: 100 GB Traffic :: ..'); " | php

Expected result:
----------------
0

Actual result:
--------------
PHP Fatal error: Class '.. ' not found

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-27 13:53 UTC] tautolog at gmail dot com
Hi again,

I built 5.2.4 to try to reproduce it myself, but I was unable to reproduce it with the code I provided. I got the expected result, not the error. I was thinking that perhaps the use of Zend Guard and Zend Optimizer may have something to do with it. I am still investigating...

Thanks,

Ben
 [2007-09-29 03:05 UTC] jani@php.net
We don't support any 3rd party extensions. This includes the Zend Optimizer and such. (ask support for those at zend.com instead)

If you're able to reproduce this without any zend extensions enabled (any extension enabled using zend_extension directive in php.ini is one :) send me an email. 

Otherwise this is bogus.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC