This appears not a bug, but an expected behaviour for me.
Let's change it from "Critial" to "Won't Fix" or so on.

---------------------------------------------------------------
<?php
$ragged = array();
for ($count = 0; $count < 10; $count++) {
    $ragged[$count] = "$count";
    $ragged[$count]['idx'] = "$count";
}
for ($count = 0; $count < 10; $count++) {
    printf("single %d: %s\n", $count, $ragged[$count]);
    printf("ragged %d: %s\n", $count, $ragged[$count]['idx']);
}
?>
---------------------------------------------------------------

The above snippet is actually a variant of the following code:
---------------------------------------------------------------
<?php
$ragged = array();
for ($count = 0; $count < 10; $count++) {
    $ragged[$count] = (string)$count;
    $ragged[$count]{(int)'idx'} = (string)$count;
}
for ($count = 0; $count < 10; $count++) {
    printf("single %d: %s\n", $count, $ragged[$count]);
    printf("ragged %d: %s\n", $count, $ragged[$count]{(int)'idx'});
}
?>
---------------------------------------------------------------
Then, "Cannot use a scalar value as an array" warnings are due to
applications of braces for non-string variables.
But I can't still explain why leaks occured.

Moriyoshi


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

Reply via email to