rfc:shortsyntaxforarrays:vote

This is an old revision of the document!


Square bracket array shortcut - keys and values are separated by colons

    $a = [1, 2, 3];
    $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];

+1

  1. shein
  2. iliaa

-1

None

Square bracket array shortcut - keys and values are separated by double arrows

    $a = [1, 2, 3];
    $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];

+1

  1. zeev (would consider parentheses for max compatibility with current syntax, minus the array keyword, i.e. (1, 2, 3))
  2. patrickallaert
  3. colder
  4. pierrick
  5. aharvey
  6. gwynne
  7. tyrael
  8. pajoye
  9. chregu
  10. dsp
  11. salathe
  12. rdohms
  13. guilhermeblanco
  14. davidc
  15. hartmut
  16. mfonda
  17. davidvega
  18. mgf
  19. shiflett
  20. stas
  21. andi
  22. stewartlord

-1

None

-1 on both syntax

  1. cataphract
  2. dtajchreber
  3. derick

Current votes, but without info about which syntax to choose:

+1

  1. kalle
  2. brianlmoon
  3. stas
  4. iliaa
  5. rasmus
  6. fmk
  7. cstockton
  8. sean (but please see the object PLUS array literals RFC)
rfc/shortsyntaxforarrays/vote.1307292116.txt.gz · Last modified: 2017/09/22 13:28 (external edit)