Re: [PHP-DEV] New RFC : empty() function

2023-10-31 Thread Kamil Tekiela
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-31 Thread Alessandro Rosa
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-31 Thread G. P. B.
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-31 Thread Alessandro Rosa
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-31 Thread Marcos Marcolin
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-31 Thread Alessandro Rosa
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/

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Rowan Tommins
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Kamil Tekiela
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Hamza Ahmad
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Alessandro Rosa
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread tag Knife
> > 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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Alessandro Rosa
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Lynn
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread tag Knife
> > 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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Lynn
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Marcos Marcolin
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Aleksander Machniak
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

Re: [PHP-DEV] New RFC : empty() function

2023-10-30 Thread Kamil Tekiela
Hi, I don't understand what you are proposing and what problem you are trying to fix. The RFC is not explaining things well.

[PHP-DEV] New RFC : empty() function

2023-10-30 Thread Alessandro Rosa
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

Re: [PHP-DEV] New RFC about variables.

2019-01-25 Thread Rowan Collins
On Fri, 25 Jan 2019 at 10:32, Глеб Жуков wrote: > Hi, my name is Gleb Zhukov. > > In my RFC I want to propose to use a new entities(abstractions), like > *objects*, *structures* and *data* instead of variables. It gives such > advatege like a mental division of different, independent entities(obj

Re: [PHP-DEV] New RFC about variables.

2019-01-25 Thread Michał Brzuchalski
Is this a joke? pt., 25 sty 2019 o 11:32 Глеб Жуков napisał(a): > Hi, my name is Gleb Zhukov. > > In my RFC I want to propose to use a new entities(abstractions), like > *objects*, *structures* and *data* instead of variables. It gives such > advatege like a mental division of different, indepen

[PHP-DEV] New RFC about variables.

2019-01-25 Thread Глеб Жуков
Hi, my name is Gleb Zhukov. In my RFC I want to propose to use a new entities(abstractions), like *objects*, *structures* and *data* instead of variables. It gives such advatege like a mental division of different, independent entities(objects, structures, data) in any language. For example //If

Re: [PHP-DEV] New RFC

2016-08-02 Thread Dan Ackroyd
> On 2 Aug 2016, at 09:56, Christoph Becker wrote: > For the record: there has been the "Array Of" RFC[1], but that has been > declined. It was declined because of the implementation, rather than the idea. A new proposal with a different implementation should be welcomed to be considered. Ch

Re: [PHP-DEV] New RFC

2016-08-02 Thread Rowan Collins
On 02/08/2016 09:56, Christoph Becker wrote: For the record: there has been the "Array Of" RFC[1], but that has been declined. [1] If I remember rightly, the biggest problem raised with typed arrays is that type constraints in PHP are checked dynamically eve

Re: Re: [PHP-DEV] New RFC

2016-08-02 Thread Tomáš Holan
Oh that's sad, cause it's missing feature. But what we can do. Thanks for info  Christoph. - Původní zpráva - Odesilatel: "Christoph Becker" Příjemce: "Dan Ackroyd" , "Tomáš Holan" Kopie: internals@lists.php.net Datum: 02.08.2016 10

Re: [PHP-DEV] New RFC

2016-08-02 Thread Christoph Becker
On 02.08.2016 at 09:11, Dan Ackroyd wrote: > It has been thought about, and several people are looking at an > implementation of generics: https://wiki.php.net/rfc/generics However, > it seems quite hard to implement. > > I am beginning to wonder if rather than aiming for full support of > generi

Re: [PHP-DEV] New RFC

2016-08-02 Thread Peter Lind
On 2 August 2016 at 09:11, Dan Ackroyd wrote: > Hi Tomáš, > > It has been thought about, and several people are looking at an > implementation of generics: https://wiki.php.net/rfc/generics However, > it seems quite hard to implement. > > I am beginning to wonder if rather than aiming for full su

Re: [PHP-DEV] New RFC

2016-08-02 Thread Dan Ackroyd
Hi Tomáš, It has been thought about, and several people are looking at an implementation of generics: https://wiki.php.net/rfc/generics However, it seems quite hard to implement. I am beginning to wonder if rather than aiming for full support of generics listed in that RFC, instead we just aimed

[PHP-DEV] New RFC

2016-08-01 Thread Tomáš Holan
Hi, cause of my english, I think it's not good idea to wrote new RFC. But, there is feature which missing in PHP 7+. As you release new PHP version with type hinting and return type, you forgot for objects array like in JAVA or .NET For better understand there is example of syntax in JAVA Playe

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Dan Ackroyd
On 14 April 2015 at 17:39, Johannes Ott wrote: > Am 14.04.2015 um 16:33 schrieb Dan Ackroyd: > >> Here is some feedback then: >> Johannes Ott wrote: > But in the new draft (v0.4) I'm preparing at the moment I'll try to > formulate the trigger "first call" more common by comparing it to the > same

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Johannes Ott
Am 14.04.2015 um 16:33 schrieb Dan Ackroyd: > Here is some feedback then: > > From the RFC: >> - Trigger for “magic” method call: First call to class, either first call to >> __construct(...) or first call to any public or protected static method or >> property of the class > > I don't think t

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Jakub Kubíček
I would rather appreciate run-time class properties initialization. Best regards, Kubo2 2015-04-13 15:37 GMT+02:00 Johannes Ott : > Hi, > > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far an

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Dan Ackroyd
Hi Johannes, On 13 April 2015 at 13:37, Johannes Ott wrote: > Hi, > > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. Here is some feedback then:

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Johannes Schlüter
On Tue, 2015-04-14 at 11:49 +0200, Johannes Ott wrote: > Am 14.04.2015 um 00:16 schrieb Levi Morrison: > >> - IMO, the method should be called when the class is created, just after > >> every parent class and implemented interfaces are created. > > > > In general I think static class data and sta

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Johannes Ott
Am 14.04.2015 um 00:16 schrieb Levi Morrison: >> - IMO, the method should be called when the class is created, just after >> every parent class and implemented interfaces are created. > > In general I think static class data and static class constructors are > a sign of poorly designed code, whic

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Marcio Almada
Hi, 2015-04-13 10:37 GMT-03:00 Johannes Ott : > Hi, > > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. > > As I already mentioned in the prediscussi

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Schlüter
On Mon, 2015-04-13 at 21:14 +0200, Johannes Ott wrote: > The obvious task is to initial the state of the class before usage as I > wrote inside my introduction of the RFC. That is one possible task users are going to try doing. Users are more creative. > I think there is no "random" behavior (not

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Levi Morrison
On Mon, Apr 13, 2015 at 7:37 AM, Johannes Ott wrote: > Hi, > > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. The static constructor cannot be call

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Levi Morrison
> - IMO, the method should be called when the class is created, just after > every parent class and implemented interfaces are created. In general I think static class data and static class constructors are a sign of poorly designed code, which means I am against this feature. If it does make it

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread S.A.N
> Okay I will think about the alternative names, I somehow like > __classInit you proposed or __classConstruct I like simple: __init() -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Am 13.04.2015 um 18:54 schrieb Johannes Schlüter: > On Mon, 2015-04-13 at 17:23 +0200, Johannes Schlüter wrote: >> Why am I saying it makes the language more complex? - Your proposal >> seems to miss mentioning when exactly the method is executed. what is > > Ah, I missed this > > Trigger

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Schlüter
On Mon, 2015-04-13 at 17:23 +0200, Johannes Schlüter wrote: > Why am I saying it makes the language more complex? - Your proposal > seems to miss mentioning when exactly the method is executed. what is Ah, I missed this Trigger for “magic” method call: First call to class, either

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Am 13.04.2015 um 18:02 schrieb François Laupretre: >> De : Johannes Ott [mailto:m...@deroetzi.de] >> finally I managed to do my first RFC draft. >> >> https://wiki.php.net/rfc/static_class_constructor >> >> I hope I have done everything correct so far and I'm looking forward to >> your feedback on

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Am 13.04.2015 um 17:29 schrieb Benjamin Eberlei: > What would happen if you "call the parent constructor": > > class A extends B { >static public function __static() { > B::__static(); >} > } > Please have a closer look to the definition of the function: https://wiki.php.net/rfc

RE: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread François Laupretre
> De : Johannes Ott [mailto:m...@deroetzi.de] > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. Interesting. It also allows to respect PSR-1, which

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Benjamin Eberlei
What would happen if you "call the parent constructor": class A extends B { static public function __static() { B::__static(); } } On Mon, Apr 13, 2015 at 5:23 PM, Johannes Schlüter wrote: > Hi, > > On Mon, 2015-04-13 at 15:37 +0200, Johannes Ott wrote: > > finally I managed to do

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Schlüter
Hi, On Mon, 2015-04-13 at 15:37 +0200, Johannes Ott wrote: > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. In my opinion this makes the language

[PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Hi, finally I managed to do my first RFC draft. https://wiki.php.net/rfc/static_class_constructor I hope I have done everything correct so far and I'm looking forward to your feedback on it. As I already mentioned in the prediscussion thread here: For being my first change to the PHP core, I w