ID: 14763
Updated by: georg
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Feature/Change Request
Operating System: 
PHP Version: 4.1.1
New Comment:

There is no need to make an array '$a[]' readable.

$a[] = "foo";

is short for

$a[count($a)] = "foo";

if $a[] would be readable, result would be always NULL:

$b = $a[] ( which would be the same as $a[count($a)])


Previous Comments:
------------------------------------------------------------------------

[2001-12-30 04:29:01] [EMAIL PROTECTED]

Currently in php, you can append to a variable by using the [] form:

$a[] = 'a';
$a[] = 'b';

It would be great if you could also read an array in the same manner, ie:

$lastadded = $a[];

which would be equivalent to 
$lastadded = $a[count($a)-1];
which is what you have to do today.

/linus

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=14763&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to