php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31604 Object calls fail within same method
Submitted: 2005-01-19 04:49 UTC Modified: 2005-01-19 09:06 UTC
From: johnjawed at gmail dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.3 OS: Fedora/Windows XP
Private report: No CVE-ID: None
 [2005-01-19 04:49 UTC] johnjawed at gmail dot com
Description:
------------
The following code should print "Bugged". It does not. Furthermore, it seems the phpout stream stops completely because any further text after the function will not be outputted...whether it's printed via one of PHP's functions or just in regular text. To me, it seemed like a fatal error occured but without any sort of message (discounting the "This document contains no data" message from Firefox).

The behavior is identical on both my Fedora and Windows XP box with Apache2 and Apache 1.3. 

I did a little experiment with it on my Windows box. I uncommented this:

;extension=php_mysql.dll

As I did not need to use this before (MySQLi is better 8) ). However, I dropped the libmysql.dll from the system altogether to make PHP complain about "Entry point missing for php_mysql.dll", which is a warning but will still load PHP just fine (minus MySQL of course).

I went back to the bugged script, and as I was hoping, it complained "Entry point missing for php_mysql.dll". I believe that this bug actually causes PHP to reload it's extensions.

My setup (identical across both systems):

PHP5.0.3 w/
MySQLi
PostgreSQL
cURL
gd2
Apache2 (2.5.2) alternatively Apache 1.3

Reproduce code:
---------------
<?PHP
class clsWhatever {
	
	public function CheckBug() {
		if(clsWhatever::CheckBug())
		return true;
		else
		return true;
	}
}

class clsSecondClass {

	public function invokeBug() {
		if(clsWhatever::CheckBug()) {
			print("Bugged");
		}
	}
}

clsSecondClass::invokeBug();

?>

Expected result:
----------------
Nothing, that's the problem. 8p

Actual result:
--------------
No backtrace available, debugger won't pickup file since nothing is ever sent to the browser to begin with.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-19 04:58 UTC] johnjawed at gmail dot com
Expected result should be phpout stream sending string:

"Bugged"

Actual result is nothing is sent.
 [2005-01-19 09:06 UTC] derick@php.net
You have an infinite recursuion here where clsWhatever::CheckBug() is calling itself all the time. This causes PHP to die because of stack starvation. Fix your code!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 19:01:30 2024 UTC