Hacker News new | ask | show | jobs
by lysol 4675 days ago
Another thing I didn't notice earlier, after perusing the implemented RFCs: More Python-like array syntax:

[1, 2, 3] ['key1': 'val1', 'key2': 'val2']

We've been on 5.4+ at work for some time now and if I'd know that a year ago it would've saved me a lot of array()s and visual noise.

1 comments

The colon-based syntax was voted down.

What went live in 5.4 was support for brackets in lieu of array()

    // Typical array syntax
    $arr = array('key' => 'asdf');

    // Supported in 5.4+
    $arr = ['key' => 'asdf'];