Re: [PHP] PHP 4 to 5 class issues involving static methods and $this

2004-11-17 Thread Klaus Reimer
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

[PHP] PHP 4 to 5 class issues involving static methods and $this

2004-11-17 Thread Chris
I have a class where I need to be able to use the methods as static methods as well as using them inside an initialized class. Here's an example of what I need to do: class my_class { var $elements = array(); // holds all of my elements function format_string($string) {