I am forced to use PHP 4 due to hosting problems, thus any OOP advancements from php 5 are not applicable here...
My real point of this question is, 'Can you create static functions in PHP 4?".
Say I have a class named Foobar and this class has a method called getMatchingFoobars, which returns an array of Foobars that match a database query (called param here). I've used this pattern extensively in Java, but I can't seem to apply it to PHP 4.
What I'd really like to do is something along these lines:
$matchingFoobars = Foobar->getMatchingFoobars(params);
or
$matchingFoobars = new Foobar()->getMatchingFoobars(params);
but instead it seems like I have to do the following:
$aFoobar = new Foobar;
$matchingFoobars = $aFoobar->getMatchingFoobars(params);
Am I missing something?
Thanks