4 ms·
$a1 = [1, 2, 3]; $b1 = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon']; $b2 = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon']; $a1 = arra
by whichdan 15y ago
$a1 = [1, 2, 3];
$b1 = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];
$b2 = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];
$a1 = array(1, 2, 3);
$b1 = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');
It would be a nice change to have, but the syntax isn't -that- much better. A compromise might be:
$b1 = array('foo': 'orange', 'bar': 'apple', 'baz': 'lemon');
But even then, you only save two characters per key:value.
- mcantelon 15y agoThe less visual noise the better.