php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39000 Attempting to set a subclass' private property in __set crashes PHP (& Apache)
Submitted: 2006-09-30 05:07 UTC Modified: 2006-10-08 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: kzantow at gmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.1.6 OS: Windows XP SP2
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: kzantow at gmail dot com
New email:
PHP Version: OS:

 

 [2006-09-30 05:07 UTC] kzantow at gmail dot com
Description:
------------
Attempting to set a subclass' private property in __set causes PHP 5.1.6 (and Apache 2.2.3 using XAMPP 1.5.4) to crash.

Reproduce code:
---------------
class CrashParent {
	public function __set($propertyName, $value) {
		$this->$propertyName = $value;
	}
}

class CrashChild extends CrashParent {
	private $a_property;
}

$instance = new CrashChild();

// Crash here:
$instance->a_property = "a new value";


Expected result:
----------------
Not sure. Either an error indicating you may not set a subclass' private property or preferably the property to be set.

Actual result:
--------------
Crash.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-30 12:40 UTC] bjori@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Can't reproduce
 [2006-10-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 03:01:30 2025 UTC