Bug #53508 [Fbk->Opn]: Class not found caused by require_once

From: Date: Tue, 14 Dec 2010 12:14:53 +0000
Subject: Bug #53508 [Fbk->Opn]: Class not found caused by require_once
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156991@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53508&edit=1

 ID:                 53508
 User updated by:    exsystemchina at gmail dot com
 Reported by:        exsystemchina at gmail dot com
 Summary:            Class not found caused by require_once
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Mac OS X 10.6
 PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

ok, i have just know that a login is needed to download the zip
file.....
now i have shorten the buggy code.


Previous Comments:
------------------------------------------------------------------------
[2010-12-13 10:18:21] aharvey@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------
[2010-12-10 13:39:52] exsystemchina at gmail dot com

I found that if I put require_once at the end of the php file, the fatal
error 
won't appear any more... just inspired by another bug report.

------------------------------------------------------------------------
[2010-12-09 15:47:56] exsystemchina at gmail dot com

Description:
------------
A weird bug, appears only when the script contains require_once:
A class is defined with an interface implemented, but the PHP
interpreter produces 
a fatal error saying class not defined. But everything goes well if the
class 
doesn't implemented an interface.

Test script:
---------------
Download this file, and unzip it:
http://files.cnblogs.com/ExSystem/FrameworkDSW.zip
Make sure your php include_path contains the parent directory of
FrameworkDSW, and to set error reporting level to E_ALL in case.
Run FrameworkDSW\System.php, and get the fatal error.
****And only the classes defined before the declaration of TObject
inside System.php are declared succesfully(I guess it by invoking
get_declared_classes()).

Then modify the line 285 of System.php to
class TObject {
rather than
class TObject implements IInterface {
and run it again, to see the difference.
****And all the classes inside System.php are declared successfully.

Expected result:
----------------
<Nothing>

Actual result:
--------------
<br />
<b>Fatal error</b>:  Class 'TObject' not found in 
<b>{your_include_path}\FrameworkDSW\Utilities.php</b> on line
<b>81</b><br />


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53508&edit=1


Thread (12 messages)

« previous php.bugs (#156991) next »