Hi Alessandro,
I would still advise to just let this empty() construct die a natural
death.
If you want to change anything, you must remember that it's basically a
syntactic sugar for `@!$var`
For example if(empty($var)) is just if(@!$var)
To change this function would require changing the rule
Thank you, G.P.B. for editing and for sharing your honest viewpoint.
I saw your corrections and already fixed some flaws in the RFC text.
I raised issues that are critical on my modest viewpoint.
I see languages as an optimal mix between semantics, grammar and
performance.
The built-in empty() fun
On Tue, 31 Oct 2023 at 11:23, Alessandro Rosa
wrote:
> Hi Marcos,
>
> thanks for feedback.
> Could you be clearer about your advice and gimme an example please?
>
I have edited the RFC content to add highlighting, hopefully you can now
use that to improve the RFC text.
However, I'm not very con
Hi Marcos,
thanks for feedback.
Could you be clearer about your advice and gimme an example please?
Alessandro
Il giorno mar 31 ott 2023 alle ore 11:59 Marcos Marcolin <
marcolin...@gmail.com> ha scritto:
> Hi Alessandro,
>
> It would be better to add syntax highlighting to the code examples of
Hi Alessandro,
It would be better to add syntax highlighting to the code examples of
your RFC, it is not legal to read/understand the texts as if they were
just texts.
---
Marcos Marcolin
Software Engineer | PHP
www.marcosmarcolin.com.br
Hi Mr. Tommins,
thank you very much for all your very valuable advices.
You can read a more robust discussion about my RFC at
https://wiki.php.net/rfc/empty_function
Regards,
Alessandro Rosa
Il giorno lun 30 ott 2023 alle ore 23:54 Rowan Tommins <
rowan.coll...@gmail.com> ha scritto:
> On 30/
On 30/10/2023 12:24, Alessandro Rosa wrote:
I have posted a new RFC at this link
https://wiki.php.net/rfc/empty_function where I suggested some
improvements to the standard built-in empty() function and provided a
number of examples.
Hi, and welcome!
First, regarding the clarity of the pro
I would be voting against any function that checks for "empty". The
`empty()` construct we have now should almost never be used in any
reasonable code. It should be avoided at all cost. For this reason, I
see no need to introduce a new variant of the same thing. I also don't
believe there is any ne
Hi there, it's a legacy function, and I don't think we can afford or
we should consider this bc break. Though I don't use this function
myself and also prefer other methods of input validation, still there
are a lot of people that use it. Renaming this to is_empty will bring
a bc break. However, th
Thanks everybody for joining this discussion.
I appreciated a lot the points you raised, as they are helping me to
update and improve my rfc,
whose meaning, as I hope, would look clearer than the earlier version.
Improvements must be achieved, whatever they would cost.
Ambiguities shall be resolv
>
> This is exactly where the problem lies. Is a string with just whitespace
> empty? Why would an ArrayObject with count 0 not be considered to be empty
> while an array with count 0 is? "empty" is subjective and therefore not a
> reliable function to use. Especially in legacy code I find that peo
Thanks everybody for joining this discussion.
I appreciated a lot the points you raised, as they are helping me to
update and improve my rfc,
whose meaning, as I hope, would look clearer than the earlier version.
Alessandro
Il giorno lun 30 ott 2023 alle ore 16:36 Lynn ha scritto:
> On Mon, Oc
On Mon, Oct 30, 2023 at 4:21 PM tag Knife wrote:
> >
> > However, according to my example, the variable is defined and has its
> > value as 0 or false, and empty() returns true anyway. I confess that
> > I've had some problems like this, and we chose not to use empty(), as
> > sometimes 0 or fals
>
> However, according to my example, the variable is defined and has its
> value as 0 or false, and empty() returns true anyway. I confess that
> I've had some problems like this, and we chose not to use empty(), as
> sometimes 0 or false makes sense as a valid value.
>
That is exactly as the doc
On Mon, Oct 30, 2023 at 1:24 PM Alessandro Rosa
wrote:
> Hi,
>
> I have posted a new RFC at this link
> https://wiki.php.net/rfc/empty_function
> where I suggested some improvements to the standard built-in empty()
> function and provided a number of examples.
>
> Thanks,
>
> Alessandro Rosa
> WE
Hello,
I understand that the idea of the RFC is about some behaviors of
empty(), e.g.:
```php $var = ''; var_dump(empty($var)); // true $var= [];
var_dump(empty($var)); // true $var= 0; var_dump(empty($var)); // true
var_dump(empty($empty)); // true $var= true; var_dump(empty($var)); //
f
On 30.10.2023 13:24, Alessandro Rosa wrote:
Hi,
I have posted a new RFC at this link https://wiki.php.net/rfc/empty_function
where I suggested some improvements to the standard built-in empty()
function and provided a number of examples.
Forget about deprecating empty(). No chance I'd vote for
Hi,
I don't understand what you are proposing and what problem you are trying
to fix. The RFC is not explaining things well.
Hi,
I have posted a new RFC at this link https://wiki.php.net/rfc/empty_function
where I suggested some improvements to the standard built-in empty()
function and provided a number of examples.
Thanks,
Alessandro Rosa
WEB : http://alessandrorosa.altervista.org
LINKEDIN : https://www.linkedin.com
19 matches
Mail list logo