Edit report at https://bugs.php.net/bug.php?id=55422&edit=1
ID: 55422
User updated by: amaury dot carrade at free dot fr
Reported by: amaury dot carrade at free dot fr
-Summary: Break execution when the inclusion of a class
+Summary: Stop interpretation without errors when the
inclusion of a class
Status: Open
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:
(title change)
Previous Comments:
------------------------------------------------------------------------
[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