How to declare a static object in PHP?



Hi experts,

I am new to PHP, I have a HashMap class and want to declare as static
in my other class,

class web
{
public static $map = new HashMap();

}

somehow the compiler is complaining. It only allows me to do the
following:

class web
{
public static $map;

public __construct()
{
map = new HashMap();
}

}

but I don't want this, sorry for my stupid questions, i was coming
from C++ and Java background, so I am not quite familar with the
syntax in PHP.

Thanks alot

Best regards
ferdinand
.



Relevant Pages

  • Re: How to declare a static object in PHP?
    ... I am new to PHP, I have a HashMap class and want to declare as static ... public static $map = new HashMap; ... public function __construct ...
    (php.general)
  • Re: Object Oriented Content System - the idea
    ... > be shared among subsequent requests is any indication I assumed PHP re-parsed ... global map: It only needs to be checked to be in sinc with the file at ... PHP5 has two ways to do this: you can either use member ... Order with a multi value propety 'orderLines' of type 'OrderLine', ...
    (comp.lang.php)
  • Re: Dynamic Maps with php??
    ... Take a look at www.mountainviews.ie which uses dynamic maps built from php, ... >their hiking routes using drop lists or checkboxes containing the names and ... >have asked for a map, rather than lists, and want to open the application ... > routes, by somehow selecting lines on a map, then somehow pass this to a ...
    (comp.lang.php)
  • Re: geographical coordinates
    ... How can this be done in PHP? ... With a clever mix of CSS and absolute positioning. ... Let's suppose you have a HTML element (e.g. an tag with the map ... After you have tested t works in the major browsers, then replace the offset ...
    (comp.lang.php)
  • Re: creating a print_r-like function
    ... I am working on a map of a rather large php project that I've been ... I can scan my php files and pull out references to php file names. ... I'm having problems with the function that reads the array ...
    (comp.lang.php)