Re: [RFC] unset(): return bool if the variable has existed

From: Date: Wed, 06 Mar 2013 21:49:44 +0000
Subject: Re: [RFC] unset(): return bool if the variable has existed
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Am 06.03.2013 um 22:47 schrieb "Ferenc Kovacs" <[email protected]>:

> 
> 
> 
> On Wed, Mar 6, 2013 at 10:41 PM, Bob Weinand <[email protected]> wrote:
> Am 06.03.2013 um 22:38 schrieb "Ferenc Kovacs" <[email protected]>:
> 
>> 
>> On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand <[email protected]> wrote:
>> Hi!
>> 
>> As this seem to require a RFC, here is it:
>> 
>> https://wiki.php.net/rfc/unset_bool
>> 
>> Please feedback,
>> 
>> Bob Weinand
>> 
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> unset is not a function, but a language construct, and there is at least one similar
>> construct which doesn't return anything (eg. not returning NULL, but syntax error when used in
>> a return context): echo
>> 
>> -- 
>> Ferenc Kovács
>> @Tyr43l - http://tyrael.hu
> 
> 
> Echo doesn't behave as a function as it doesn't need parenthesis etc. (and has an
> equivalent which can be used as alternative: print)
> 
> I'd consider unset as a function in form of a language construct.
> 
> Bob Weinand
> 
> I'm not sure that we should change our terminology based on whether or not a language
> construct requires the parenthesis or not.
> there are other differences in behavior, for example $foo =
> "print";$foo("bar"); won't work even thought that print("bar");
> look likes as a function call.
> 
> 
> -- 
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu

Ok; I think it's better not to argue about this...

Bob Weinand


Thread (21 messages)

« previous php.internals (#66509) next »