Arrays in PHP 5.5
Hello guys, I want to share a new way of writing arrays in php.
<b>before PHP 5.5:</b>
<i>$nome = array ('Daniel', 'PHP', 'World');</i>
<b>after PHP 5.5:</b>
<i>$nome = ['Daniel', 'PHP', 'World'];</i>
Written by Daniel Rodrigues Lima
Related protips
4 Responses

it's feature from 5.4 update, isn't?
over 1 year ago
·

this is only possible from php 5.5
over 1 year ago
·

nope. 5.4 is the rigth version http://php.net/manual/en/migration54.new-features.php
over 1 year ago
·

you are right, thanks for the correction, although the tip is valid for php 5.5
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#