Re: [PHP-DEV] [VOTE] array_key_first(), array_key_last(), array_value_first(),array_value_last()

2018-07-15 Thread Levi Morrison
Not sure what timezone you are in; current votes are: Add array_key_first() and array_key_last()? - Yes (19) - No (13) Add array_value_first() and array_value_last()? - Yes (16) - No (17) The first vote will pass with 59.375%. The second fails at ~48.48%. -- PHP Internals - PHP

Re: [PHP-DEV] Non-nullable properties

2018-07-15 Thread Dan Ackroyd
On 14 July 2018 at 14:09, Rowan Collins wrote: > Hi all, > > The current RFC proposes the next simplest solution, which is to allow > non-nullable types, and trust the user to initialise them before use. >From the RFC: > If a typed property does not have a default value, no implicit null

[PHP-DEV] [RFC] Optional typehint check for parameters

2018-07-15 Thread Zeljko Mitic
PHP is dynamic language and each typed typehinted parameter has to be checked every time. I am suggesting new php.ini value "typecheck.enable = 1" which can be turned off. Example: with default php config, a code like this would check each member of $users array: function demo(User ...$users) {}

Re: [PHP-DEV] Non-nullable properties

2018-07-15 Thread Rowan Collins
On 14 July 2018 19:29:23 BST, Levi Morrison wrote: >Whether it's a constructor, a factory method, or just a block of code >near the `new` site: something has the responsibility for >initialization. Indeed, and my suggestion is to formalise that responsibility, so that mistakes can be detected