FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » declaring private variable in class
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
declaring private variable in class [message #175690] Thu, 20 October 2011 20:56 Go to previous message
DavidB is currently offline  DavidB
Messages: 2
Registered: October 2011
Karma:
Junior Member
Hi:

I created a class and then declared a private variable called today and set it = to today's date:

class someclass
{
private $today = date("Y-m-d");
}

For some reason, it doesn't like it. There is an error message about the parenthesis. Am I not allowed to set a variable = to some function like date or whatever? It didn't complain when I set it = to some string constant like "2011-10-10".
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: This is a total php newbie question
Next Topic: Queuing at job from within php program?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 16:45:58 GMT 2024

Total time taken to generate the page: 0.03241 seconds