Bug #55422 [Opn->Fbk]: Stop interpretation without errors when the inclusion of a class
| From: | aharvey@php.net | Date: | Sun, 28 Aug 2011 02:11:06 +0000 |
| Subject: | Bug #55422 [Opn->Fbk]: Stop interpretation without errors when the inclusion of a class | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162972@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55422&edit=1
ID: 55422
Updated by: aharvey@php.net
Reported by: amaury dot carrade at free dot fr
Summary: Stop interpretation without errors when the
inclusion of a class
-Status: Open
+Status: Feedback
Type: Bug
Package: Unknown/Other Function
Operating System: Windows 7 SP 1
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
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.
There just isn't enough to go on here, I'm afraid. Without some sort of reproduction case,
I can't see what we can do here.
Previous Comments:
------------------------------------------------------------------------
[2011-08-15 03:16:54] amaury dot carrade at free dot fr
(title change)
------------------------------------------------------------------------
[2011-08-15 02:23:35] amaury dot carrade at free dot fr
And I add an other class-name : "Wnl_Form".
------------------------------------------------------------------------
[2011-08-15 01:18:46] amaury dot carrade at free dot fr
Description:
------------
Hello.
The problem is simple but critical: when I include a file containing a class, most of the time, no
problem. However, sometimes it shuts off the script without any error. A sharp break without any
explanation.
Moreover, this happens with classes in various names, depending on the time. Currently, with classes
named "Wnl_Date", "Wnl_Controller" and "Wnl_View_Helper_Url".
The auto-load classes are called conventionally (Wnl_View_Helper_Url) statically (Wnl_Dateà or by
inheritance (Wnl_Controller).
This problem suddenly appeared a few days ago. At first, it appeared from time to time, now
it's all the time.
And this bug stops me completely!
I use PHP with easyPHP (the last version), a WAMP software.
Test script:
---------------
I do not really have an example code: This problem occurs in variety of cases, while the inclusion
of a class, either directly or via an autoloader.
Code of the autoloader:
<?php
// Preliminary codes
define('S', DIRECTORY_SEPARATOR, true);
define('ROOT_PATH', dirname(__FILE__), true);
define('LIB_PATH', ROOT_PATH.S.'lib'.S.'php'.S, true);
/**
* This function replace the slash (/) by anti-slash, if needed.
* @param $path string The path to edit.
* @return The good path, with \ (Win) or / (other).
*/
function rs($path) {
$path = str_replace('/', S, $path);
$path = str_replace('\\', S, $path);
return $path;
}
function __autoload($classe) {
if(preg_match('#^Zend_#', $classe)) {
$classe = str_replace('_', S, $classe);
require_once(rs($classe . '.php'));
}
else {
$classe = str_replace('_', S, $classe);
require_once(rs(LIB_PATH . $classe . '.php'));
}
}
?>
Direct version :
<?php
include(ROOT_PATH . '/lib/php/Wnl/Date.php');
?>
Expected result:
----------------
The inclusion of the class.
Actual result:
--------------
The execution is stopped without any error message, explanation or other.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55422&edit=1