php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34317 static variable is set to 0 after reload
Submitted: 2005-08-31 15:24 UTC Modified: 2005-08-31 17:33 UTC
From: abstractd at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.1.0RC1 OS: Windows
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: abstractd at gmail dot com
New email:
PHP Version: OS:

 

 [2005-08-31 15:24 UTC] abstractd at gmail dot com
Description:
------------
When reloading the page, the values in the abstract baseclass is reinitialized. They should (atleast I think so) stay the same!

Code: http://pastebin.com/350950

Is this a bug?

Expected result:
----------------
Before reloading the page:
B: 2
C: 2

After reloading the page:

B: 2
C: 2


Actual result:
--------------
Before reloading the page:
B: 2
C: 2

After reloading the page:

B: 0
C: 0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-31 16:39 UTC] sniper@php.net
Please don't put objects in $_SESSION as that doesn't really work and never will. Can you provide a reproducing script without using session?

 [2005-08-31 17:33 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The static property is part of the class not of the 
object, if you need the static property's value you could 
use __sleep and __wakeup methods to store it. 
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Feb 11 11:00:01 2026 UTC