On 11.02.2016 at 12:12, Yasuo Ohgaki wrote:

> Anyway, all of us know that main source of complaints about PHP is lack
> of consistency. Inconsistent APIs across modules are acceptable. It's
> modules after all. However, basic language constructs like [] and {} are
> better to have  predictable/consistent behaviors. i.e. how it  works, raised
> errors.

ACK.

> This RFC improves inconsistent behaviors a lot. Why not to add
> $str{} = 'string'? It's not complex nor BC as it raises syntax error 
> currently.

Appending to an array always adds a single element only, consider

  $a = [1,2,3];
  $a[] = [4,5];

The suggested syntax for strings would concatenate an arbitrary amount
of elements (characters) to a string.  IMHO, this would not be
consistent, but rather confusing.  The alternative interpretation to
append the first character only, would be confusing as well (besides
there would be issues with regard to multibyte character encodings).

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to