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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: glouie at acm dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-05 17:01 UTC] zeev
Upgrade
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 15:01:35 2025 UTC