Chris wrote:
How can I rewrite my class for PHP 5 to emulate the functionality I had in PHP 4 in an error free way?

Have you tried this:

function format_string($string) {
    // format the string...
    $result = string;
    if (isset($this)) $this->elements[] = $result;
    return $result;
}

In this form you can check the existance of $this. If you call the method statically then $this is not present and the elements array is not filled. If you call it non-statically then $this is present and elements is filled. The same you can do with show_all().

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to