Solved

PHP Static Properties - Reset to Default Values

Posted on 2008-10-24
3
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

623 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