php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #901 Seg fault - creating object with boolean default variable in another object
Submitted: 1998-11-05 16:27 UTC Modified: 1998-11-05 17:01 UTC
From: glouie at acm dot org Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.3 OS: Linux RedHat 5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 37 = ?
Subscribe to this entry?

 
 [1998-11-05 16:27 UTC] glouie at acm dot org
The below script causes a segmentation fault when the commented out line in the second class is uncommented. There is no crash when the default value "true" is replaced with a string or a number. It seems the problem occurs when a Boolean, true or false, is the default value for the constructor of the first class "param".

<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<?php
//	require("parm.h");



	class param {
		var	$parm;
		
		function param($inParm = true) {
			$this->parm = $inParm;
		}
		
	}

	class parmAddrTelephone extends param {
		var	$area;

		function parmAddrTelephone() {
//	Uncomment the line below
//			$this->area = new param();
		}
	}
	echo "<BR>Version 25.";

	echo "<BR>Done.";
?>
</BODY>
</HTML>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-05 17:01 UTC] zeev
Upgrade
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 04:01:30 2024 UTC