php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32982 changing static boolean in subclass
Submitted: 2005-05-09 11:13 UTC Modified: 2005-05-09 11:33 UTC
From: chiky at fansajt dot sk Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.4 OS: Windows XP
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: chiky at fansajt dot sk
New email:
PHP Version: OS:

 

 [2005-05-09 11:13 UTC] chiky at fansajt dot sk
Description:
------------
I have created a class A with static boolean variable $bool and class B which itherits from A. If I change value of $bool in class B, values A::$bool and B::$bool differ. All other types (integers and strings) works fine.
Is this a bug ?

Reproduce code:
---------------
class A
{
	public static $bool = false;
}

class B extends A
{
}

B::$bool = true;

Expected result:
----------------
B::$bool = true
A::$bool = true

Actual result:
--------------
B::$bool = true
A::$bool = false

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-09 11:33 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #30140 (same thing happens with array()..)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 11 06:01:28 2024 UTC