PHP 7.4: Splat Inconsistency
PHP 7.4 has this great new feature: splat operator now works in array expressions.
including when it is in the middle
Let's have some variadic function
<?php // PHP 5.6 - 7.4 echo sum(1,2,3, ...[4,5,6], 7,8,9); // PHP Fatal error: Cannot use positional argument after argument unpacking
of course there is a well-known workaround
and now also this
but why wasn't the original behavior fixed as well?
CommentsComments powered by Disqus