Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Creating libraries - can PHP 4 class properties retain their value between function calls?

I'm creating my own library. Even though I run PHP 5, I'm coding to PHP 4 to keep it reusable. The gist of my problem is shown in the following pseudo-code - specifically, how do I get PHP 4 to make $property retain its value between function calls?

class library_example {

var $property="";

function write($value)

function read()
   return $this->property;


I've solved this myself - the code does behave exactly as expected - I'd forgotten that I next time the page loads, it's a new instance of the class.

[eluser]Colin Williams[/eluser]
Yerp.. Stateless is the way to think

Theme © iAndrew 2016 - Forum software by © MyBB