php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20547 Classes can contain multiple function declarations - not detected by parser.
Submitted: 2002-11-21 11:59 UTC Modified: 2002-11-21 18:45 UTC
From: php at webdevelopers dot cz Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.2.2 OS: Linux
Private report: No CVE-ID: None
 [2002-11-21 11:59 UTC] php at webdevelopers dot cz
I think, that following example is self-explaining. Shouldn't the parser detect such as errors? After testing, try to uncomment line # serialize($tmp); and refresh the page - PHP hungs-up...

Danny

<?php
error_reporting(E_ALL);

class test {
	function tt() {
		echo "yooo";
	}

	function tt() {
	 	echo "neee";
	}
	
	function __sleep() {		
	}
	
	function __sleep() {		
	}
}

$tmp=new test();
$tmp->tt();

# serialize($tmp);

echo "TEST:END";
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-21 18:45 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 13 21:00:01 2025 UTC