Solved

PHP Static Properties - Reset to Default Values

Posted on 2008-10-24
3
216 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 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

11 Experts available now in Live!

Get 1:1 Help Now