> > This isn't the way isset() works, isset() will return true for a
> > variable with a value of 0
> 
> Exactly my point. Your code (with != NULL) will return false while real
> isset() will return true.

Stas, please see this execution output, your arguments about isset()/unset() 
are just plain wrong:

PHP 5.4.7 (cli) (built: Sep 13 2012 09:32:31) 
Interactive shell

php > $a = 0;
php > var_dump(isset($a));
bool(true)
php > $a = NULL;
php > var_dump(isset($a));
bool(false)
php > function b() { return 1; }
php > var_dump(isset(b()));

Fatal error: Can't use function return value in write context in php shell code 
on line 1

1) isset() on a NULL value will return false
2) isset() may not be called on the result of a function call (which is what an 
accessor is)

How would you propose to resolve this situation in a another way?  The current 
way that the RFC indicates IS a valid result for an isset call.

In fact  the way the RFC is currently for unset is perfectly valid as well, see:

php > unset($a);
php > var_dump($a);
NULL

Therefore, unset() setting the value to NULL and isset () checking against it 
being NULL is perfectly in line with the way isset/unset currently works. 

> > public read-only $xyz;      - Tells me that the property $xyz cannot be
> > written to and furthermore cannot be over-ridden (the purpose of the
> > read-only keyword).
> >
> > To be clear, the read-only keyword specifically means that no
> > sub-classes may make this property writable, in other words the
> > "non-writable" aspect means it is final.
> 
> This sounds way too complex and too much magic. I'd rather have people 
> implement it in user-space than introduce this complex
> and un-obvious convoluted concepts into the language.

Look, I've already given up on this argument anyways, read-only has already 
been removed, there has been no suitable replacement suggested but it doesn't 
really matter to me if it's in the spec or not.  Someone else can take up the 
helm on this issue.

To reiterate: read-only prevents the current and all subsequent classes from 
declaring a setter.  It enforces a type of "final" on the accessor.

Reply via email to