Shouldn't PHP array recursion throw an error?

It is true recursion, and RECURSION is not a real error message. It's not problematic, because $test is not actively recurring, and in this case var_dump is smart enough to stop before exhausting memory.

It is true recursion, and *RECURSION* is not a real error message. It's not problematic, because $test is not actively recurring, and in this case var_dump is smart enough to stop before exhausting memory.

I would guess that detecting such a loop is non-trivial, and would be immediately apparent at runtime if the behaviour was incorrect.

PHP is smart enough to identify that an array is being recursively called. The same happens if you print_r($GLOBALS), I see no harm in this.

You're setting a reference, that is, a pointer so there is no true recursion, no loop. So no, it shouldn't throw an error.

Actualy the *RECURSION* message is a error message, which ends the script execution. Else it would execute it till the memory limit is reaced.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions