Solved

PHP Static Properties - Reset to Default Values

Posted on 2008-10-24
3
217 Views
Last Modified: 2012-05-05
I am using an using a class statically, meaning we are not instantiating the object, but using it in Singleton design. How do I reset the properties to their default values since it's not instantiated?
0
Comment
Question by:laurin1
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Shahzad Fateh Ali earned 500 total points
ID: 22799090
Hi,

As static classes do not have constructors nor they can be initialized, so you will need to explicitly call a function that will reset the values of the class.

For reference,
http://wiki.php.net/rfc/static-classes
0
 
LVL 9

Expert Comment

by:Shahzad Fateh Ali
ID: 22855960
Hi,

I have object on this request, because the answer provide by myself was according to question asked. And if "laurin1" says that there was no answer then its wrong. Deleting of the question after 5 days of my answer seems the person has gotten the write answer and wants to save the points.

I hope that my object will be considered.


0
 
LVL 2

Author Comment

by:laurin1
ID: 22857351
You did not give an answer in my opinion, but told me there was not answer to my question. I already knew what you responded with, and was looking for a better solution. I belive there is probably one out there, and with so few responses, I am not convinced that I am incorrect in that assumption.

If more people weighed in on this, I would not have have asked for a delete. I don't need or want to "save" points, but again, I don't think points should be awarded for stating the obvious.

I appreciate your interaction, but I still would like the question deleted.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now