Solved

PHP Static Properties - Reset to Default Values

Posted on 2008-10-24
3
220 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use session variables in php? 22 90
Get data from two MySQL tables 6 66
Insert PHP into HTML page. 7 52
Phone number mask 4 14
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

751 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