Re: [RFC] unset(): return bool if the variable has existed
| From: | Bob Weinand | Date: | Thu, 07 Mar 2013 12:10:43 +0000 |
| Subject: | Re: [RFC] unset(): return bool if the variable has existed | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-66519@lists.php.net to get a copy of this message | ||
Am 7.3.2013 um 00:32 schrieb Stas Malyshev <smalyshev@sugarcrm.com>:
> Hi!
>
>> RFC updated.
>>
>> Any other comments about this RFC?
>
> Could you provide a use case for this - which practical value this has?
>
> It also still contains factually incorrect claim that unset() is a
> function and that there's some "inconsistency" in the fact that it does
> not return value.
>
> Also, it is not clear what false returned from unset() actually means -
> did it fail to unset the value (i.e., it is still set) or there was
> nothing to unset (i.e., it is still not set)?
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
Hi!
The main practical value is in the __unset magic method. You can now communicate through the
"proper" way of a language construct with an __unset method. (success or failure)
I've added a code example to the RFC.
Bob Weinand