|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28443 Var is changed without a reason
Submitted: 2004-05-19 09:28 UTC Modified: 2004-05-19 09:32 UTC
From: nitz at framingo dot de Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.6 OS: Win2k
Private report: No CVE-ID: None
 [2004-05-19 09:28 UTC] nitz at framingo dot de
Class constructor sets a var to a value that is only assigned to an other var.

Reproduce code:
class FG_Timestamp{
	var $timestamp;
	var $limit;

	function FG_Timestamp($ts=-1)
		echo "1 val limit=".$this->$limit."<br>";
		if ($ts<0)
		echo "2 val limit=".$this->$limit."<br>";
$cmp=new FG_Timestamp(0);

Expected result:
1 val limit=1
2 val limit=1 

Actual result:
1 val limit=1
2 val limit=2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-19 09:32 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at


you are using variable properties.. - effetcively setting $this->{\'\'}

try running with error_reporting(E_ALL);
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 07:01:28 2024 UTC