Re: Simple variable handling.

From: Date: Fri, 12 Aug 2016 09:25:56 +0000
Subject: Re: Simple variable handling.
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-95072@lists.php.net to get a copy of this message
On 12/08/16 10:07, Christoph M. Becker wrote: >> > I'm thinking >> > $var->setConstraint() >> > $var->setEscape() >> > $var->setReadOnly() >> > >> > Rather than having to build 'reflections' classes to pull out data that >> > a simple $var->is_valid or echo $var will output a correctly escaped >> > piece of text. > Actually, this is already possible; just use objects. E.g. > > class Container { > function __construct() {} > function setConstraint() {} > function setEscape() {} > function setReadOnly() {} > function isValid() {} > function __toString() {} > } > $var = new Container($some_value); This has been the problem all along. There is no overriding reason to change what we already have, but ALL of the improvements currently being discussed MAY be better handled with a return to the basic model of a variable. If a variable is 'readonly' there is no need to worry about each variable. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#95072) next »