php - New 5.4 array short array syntax: Good practice? -


i'd use new short array syntax:

# old syntax $foo = array(   'key1' => 'value1',   'key2' => 'value2',   'key3' => 'value3',   'key4' => array(     'key1' => 'value2',     'key2' => 'value2',     'key3' => 'value3',     'key4' => 'value4',   ), );  # new syntax $bar = [   'key1' => 'value1',   'key2' => 'value2',   'key3' => 'value3',   'key4' => [     'key1' => 'value1',     'key2' => 'value2',     'key3' => 'value3',     'key4' => 'value4',   ], ]; 

is syntax considered practice right now? or should stay old syntax?

usually practice related logic of code , not it's syntax, there's reason made new array syntax , reason is: faster coding , easier read. practice irrelevant here.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -