Last Updated: September 09, 2019
·
1.808K
· geekcom

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>

4 Responses
Add your response

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 ·
over 1 year ago ·

you are right, thanks for the correction, although the tip is valid for php 5.5

over 1 year ago ·