php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55422 Stop interpretation without errors when the inclusion of a class
Submitted: 2011-08-15 01:18 UTC Modified: 2013-02-18 00:34 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: amaury dot carrade at free dot fr Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.3.6 OS: Windows 7 SP 1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-08-15 01:18 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-15 02:23 UTC] amaury dot carrade at free dot fr
And I add an other class-name : "Wnl_Form".
 [2011-08-15 03:16 UTC] 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
 [2011-08-15 03:16 UTC] amaury dot carrade at free dot fr
(title change)
 [2011-08-28 02:11 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2011-08-28 02:11 UTC] 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.

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.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 01:01:31 2024 UTC