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

From: Date: Mon, 20 Dec 2010 02:55:08 +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-157105@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:

no cacher is installed.


Previous Comments:
------------------------------------------------------------------------
[2010-12-20 03:34:25] kalle@php.net

You don't happen to have any opcode cachers like APC installed?

------------------------------------------------------------------------
[2010-12-14 13:17:34] exsystemchina at gmail dot com

//System.php
<?php
require_once 'Utilities.php';

class TJustTest {
    public function __construct() {
    		var_dump(get_declared_classes());
    }
}

interface IInterface {
    public function Supports($AInterface);
}

class TObject implements IInterface {
		public function Supports($AInterface) {
				echo 'hi';
		}
}

class TJustAnotherTest {
		public function Foo() {
				echo 'foo';
		}
}
?>

//Utilities.php
<?php

require_once 'System.php';

class TSomethingBoring {
		public function Boring() {
				echo 'really boring';
		}
}

$a=new TJustTest();

class TMustBeWrong extends TObject {
		function Tragedy() {
				echo 'this will not be seen.';
		}
}
?>



Just run System.php to see the fatal error with other classes before
TObject loaded successfully 
inside System.php

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

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

------------------------------------------------------------------------
[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.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=53508


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


Thread (12 messages)

« previous php.bugs (#157105) next »