Last Updated: September 09, 2019
·
2.023K
· 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 ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#php
#5.5
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside