What’s New in PHP 7.3 in 30 Seconds in Diffs

What’s New in PHP 7.3 in 30 Seconds in Diffs

Blog
No time but eager to hear PHP news? PHP 7.3 is out in December 2018 and it brings 173 changes. Which are the most useful ones? From features that might be the most interesting to those lesser ones, that anybody will rarely use. 1. Comma After the Last Argument Do you know this? $array = [ 1, + 2, ]; We'll be able to do this: $this->someFunction( $arg, + $arg2, ); But still not this: function someFunction( $arg, + $arg2, ) {} Thanks Jacob for pointing this difference out. 25 seconds to go... 2. First and Last Array Key array_key_first $items = [ 1 => 'a', 2 => 'b', ]; -reset($items); -$firstKey = key($items); +$firstKey = array_key_first($items); var_dump($firstKey); // 1 array_key_last $items = [ 1 => 'a', 2 => 'b',…
Read More