Re: [PHP-DEV] Inline conditional that returns null if falsy

2021-02-23 Thread Albert Casademont
On Tue, Feb 23, 2021 at 6:28 PM Larry Garfield wrote: > > 1) Please don't top post. > Sorry for that! > 2) > > The advantage of ?: over long-ternary is that the part it lets you omit is > of variable size, and is often verbose (nested array elements). That's not > the case here, as the omitte

Re: [PHP-DEV] Inline conditional that returns null if falsy

2021-02-23 Thread Albert Casademont
Another example is when a scalar input needs to be either left null or converted to a Value Object: $color = $data['color'] ? new Color($data['color']) : null; This would become; $color = $data['color'] ? new Color($data['color']); //the ": null" part is implicit It's actually kinda the inverse

Re: [PHP-DEV] [RFC] opcache.no_cache: Opcache optimization without any caching

2020-05-21 Thread Albert Casademont
Hi tyson, Thanks for your RFC. As ReactPHP users this is a very welcome change. Right now we have to enable file_cache only for the optimizations, as there's no real benefit of the full opcache in long-running CLI apps. Having this setting would allow us to even stop using file_cache but get the o

Re: [PHP-DEV] [RFC] Mixed type

2020-04-20 Thread Albert Casademont
As Larry was asking for an example. The ParameterBag::get() function from Symfony (and others) that allows you to fetch request params, for example. That's a mixed type that could return different values, depending on your request body. Yes, I can type for all possible scalar values + null + array

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-11 Thread Albert Casademont
On Tue, Feb 11, 2020 at 1:59 PM Reindl Harald (privat) wrote: > > > Am 11.02.20 um 13:42 schrieb Albert Casademont: > > This is very interesting, thanks! > > > > Would it make sense to also add an INI setting to disable superglobals > and > > response func

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-11 Thread Albert Casademont
This is very interesting, thanks! Would it make sense to also add an INI setting to disable superglobals and response functions? On Tue, Feb 11, 2020 at 10:34 AM Jan Schneider wrote: > > Zitat von Paul M. Jones : > > > Hi Internals, > > > > After a couple of years of incubation, I am happy to

Re: [PHP-DEV] [RFC] JIT

2019-01-31 Thread Albert Casademont
Hi all, This is fantastic news thank you! I was going to ask if JIT would also work when Opcache is enabled with "opcache.file_cache_only". Our use case is a ReactPHP app that right now only has Opcache basically for the optimizations and we do not use the standard shared memory portion. We believ

Re: [PHP-DEV] Re: [RFC] [VOTE] Typed properties v2

2019-01-12 Thread Albert Casademont
Thank you all! Is the Perfomance section of the RFC updated? https://wiki.php.net/rfc/typed_properties_v2#performance would be great to know now that the patch is final and merged On Fri, Jan 11, 2019 at 5:45 PM Marco Pivetta wrote: > Hi Nikita, > > On Fri, Jan 11, 2019 at 5:38 PM Nikita Popov

Re: [PHP-DEV] Extension: arbitrary precision decimal arithmetic in PHP 7

2018-09-29 Thread Albert Casademont
Looks promising! Could it be added to PECL maybe? That would make it easier for people to test :D On Sat, 29 Sep 2018 at 17:46, Rudi Theunissen wrote: > Actually yes! You mentioned it to me 5 months ago in a thread on Reddit: > > https://www.reddit.com/r/PHP/comments/8fpwi4/if_php_had_a_native_d

Re: [PHP-DEV] Performance optimization ideas for PHP 7.3

2018-04-20 Thread Albert Casademont
the code of php-pm) Also Ocramius is right on the > problem of memory leaks to fix in libraries, this is something to focus on. > Another thread would be great (with more ideas to improve the situation). > > Maxime > > Le jeu. 19 avr. 2018 à 16:41, Albert Casademont < > albe

Re: [PHP-DEV] Performance optimization ideas for PHP 7.3

2018-04-19 Thread Albert Casademont
Hi Nicolas, Don’t you think the biggest performance upgrade that PHP could bring is a real application server that could keep the app bootsrapped between requests, much like php-pm/reactphp/aerys are trying to do? Best, Albert On Thu, 19 Apr 2018 at 16:11, Nicolas Grekas wrote: > Hello intern

Re: [PHP-DEV] [RFC][DISCUSSION] Revisit trailing commas in function arguments

2017-09-01 Thread Albert Casademont
Revisiting this thread. AFAIK this RFC was never put to vote, right? On Fri, Oct 16, 2015 at 9:01 PM, Björn Larsson wrote: > Den 2015-10-16 kl. 15:09, skrev Sammy Kaye Powers: > >> On Thu, Oct 15, 2015 at 8:28 PM, Marcio Almada >> wrote: >> >> Hi, >>> >>> 2015-10-14 16:25 GMT-03:00 Sammy Kaye P

Re: [PHP-DEV] [RFC DRAFT] Automatic CSRF Protection

2016-05-10 Thread Albert Casademont
Why use sessions for CSRF Protection? That an be implemented with simple cookies. https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet#Double_Submit_Cookies Btw, not sure if this should be in php core though...it's more an application thing... On Tue, May

Re: [PHP-DEV] [RFC][VOTE] OpenSSL AEAD support

2016-01-27 Thread Albert Casademont
That's great nees thanks!! On Wednesday, 27 January 2016, Jakub Zelenka wrote: > Hi, > > On Wed, Jan 20, 2016 at 4:40 PM, Jakub Zelenka > wrote: > > > Hi, > > > > The vote is now open: > > > > https://wiki.php.net/rfc/openssl_aead#voting > > > > > > > The voting has ended and the RFC has been a

Re: [PHP-DEV] [RFC] OpenSSL AEAD support

2016-01-06 Thread Albert Casademont
+1 thanks Jakub! On Wed, Jan 6, 2016 at 6:09 PM, Jakub Zelenka wrote: > Hi, > > On Wed, Jan 6, 2016 at 3:35 PM, Bishop Bettini wrote: > > > Hi Jakub, > > > > On Wed, Jan 6, 2016 at 10:01 AM, Jakub Zelenka wrote: > >> > >> https://wiki.php.net/rfc/openssl_aead > > > > > > I think the API might

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Add targets to simplify building PHP with FDO (Feedback Directed Optimisation) PHP should be built with the folowing steps:: Makefile.global configure.in

2015-05-26 Thread Albert Casademont
this is awesome, i'll give it a try with symfony too! On Tue, May 26, 2015 at 5:24 PM, Rasmus Lerdorf wrote: > On 05/26/2015 07:33 AM, Dmitry Stogov wrote: > > Commit:7dac4d449f72d7eb029aa1a8ee87aaf38e17e1c5 > > Author:Dmitry Stogov Tue, 26 May 2015 > 17:33:25 +0300 > > Parents:

Re: [PHP-DEV] Alternative PHP tags and strict_types=1

2015-05-14 Thread Albert Casademont
mmm I guess this is the correct behaviour, <% tags ar now not parsed at all and behave as plain text. If you run http://3v4l.org/uDDW3 foo wrote: > Hi! > > In php7@20150501, I've noticed that this code > produces the expected output [1]: > > <% echo 'top'; %> > > But th

Re: [PHP-DEV] password_hash() best practices

2015-05-06 Thread Albert Casademont
The iteration count is very different because in bcrypt it's not an iteration count number at all, it's a "cost". And it's kinda exponential: a hash with a cost of 11 is twice as hard to compute than that of a 10. At our company we are using a cost of 11 right now, which means a hash is computed in

Re: [PHP-DEV] RE: [PHP-CVS] com php-src: Enable GCC global register variables if available: Zend/Zend.m4 Zend/zend_execute.c

2015-03-18 Thread Albert Casademont
uld get an outstanding performance improvement of about 69% when running >>> bench.php (from 2.394 sec to 1.640 sec in average). I’ve tested this on >>> POWER 8 machines. My patch can be seen at [2] >>> >>> Thank you! >>> Caio Souza Oliveira >>>

Re: [PHP-DEV] RE: [PHP-CVS] com php-src: Enable GCC global register variables if available: Zend/Zend.m4 Zend/zend_execute.c

2015-03-17 Thread Albert Casademont Filella
Hi Dmitry, I can confirm a ~10-11% reduction in execution time of the bench.php from last month build (x64) to today's commit (from 1.154 sec to 1.010). Amazing job! Albert On Tue, Mar 17, 2015 at 1:39 PM, Gustavo Frederico Temple Pedrosa < gustavo.pedr...@eldorado.org.br> wrote: > Hi, Dmitry.

Re: [PHP-DEV] crypto_something

2015-02-26 Thread Albert Casademont Filella
Please remember that now is just impossible to use AES-GCM with the current OpenSSL extension API, there is no way to get/set the authentication tag. With AES-GCM you already get a MAC for free, that should be the default operation mode. https://bugs.php.net/bug.php?id=67304 On Thu, Feb 26, 2015

Re: [PHP-DEV] The Game Theory of Scalar Type Hint Voting

2015-02-25 Thread Albert Casademont Filella
Yep, that's what I suggested but Leigh did see a competitive advantage for weak-type hints in any case because if strict won we would have weak hints too if I didn't use the declare option. I can see that point even though it was not made at all with the intention of favouring weak vs strict, I rea

Re: [PHP-DEV] The Game Theory of Scalar Type Hint Voting

2015-02-23 Thread Albert Casademont Filella
I like it! That's what I proposed to Anthony (and Andrea before) before Zeev presented their alternative, to held a double vote on the strict vs weak feature. It was not met with much enthusiasm, hope they change their minds with your proposal! On Mon, Feb 23, 2015 at 5:43 PM, Benjamin Eberlei wr

Re: [PHP-DEV] [RFC-Discuss] Scalar Type Declarations v0.5

2015-02-18 Thread Albert Casademont Filella
Hi Anthony! Thanks for bringing this up again. I am asking you the same I asked Andrea 2 weeks ago on Twitter: make it a triple option vote please. She didn't want to do it, hope you do! This way you eliminate the neverending discussion about weak vs strict, let the votes decide and see who really

Re: [PHP-DEV] [RFC][VOTE] Removal of dead or not yet PHP7 ported SAPIs and extensions

2015-02-09 Thread Albert Casademont Filella
Just a quick side one, there's no way to make compatible calls from mcrypt to openssl using "rijndael-192" and "rijndael-256" ciphers, a compatibility layer is almost impossible. Only AES-128/192/256 (which variants of "rijndael-128") are possible on both extensions. On Mon, Feb 9, 2015 at 6:47 PM

Re: [PHP-DEV] uWSGI experimental plugin for implementing a WSGI/PSGI/Rack-like interface for PHP

2015-02-09 Thread Albert Casademont Filella
HHVM is a FastCGI interface, just like PHP-FPM is, I don't see your point here! On Mon, Feb 9, 2015 at 6:40 PM, S.A.N wrote: > 2015-02-09 12:41 GMT+02:00 Rowan Collins : > > Yes, I can see it working well for specialised uses - you can simply not > use those aspects of the language that don't ma