On Mon, Jul 16, 2018 at 4:46 AM Zeljko Mitic <mitke...@gmail.com> wrote:
> 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) {} > > but with "typecheck.enable = 0", same code would be treated like it was > written this way: > > function demo(...$users) {} > > Basically, php would simply *ignore* typehints and work like they are not > there. > What you need is DbC. It's more flexible and complete. It satisfies all of your needs and more. An issue is that DbC is not static code analysis tool friendly. https://wiki.php.net/rfc/introduce_design_by_contract https://wiki.php.net/rfc/dbc https://wiki.php.net/rfc/dbc2 Regards, -- Yasuo Ohgaki yohg...@ohgaki.net