Closed Tyrael closed 10 years ago
I'm using this a lot with Symfony2 (2.1, 2.2, 2.3, 2.4) and recursion never happened to me.
In most cases I'm using
xdebug.max_nesting_level = 200
I guess that situation will appear you passing some hydrated Doctrine object to the session.
I'm not sure but here the serialization can be helpful. Need some more info from you.
Regards, Max
unfortunately xdebug has some measurable performance impact and can also cause differences in the application behavior (http://bugs.xdebug.org/view.php?id=587 has bitten me in the past, before it got fixed). even if you consider this solution, that still means that some errors/notices can abort the execution of your script, and if errbit is your only error handler, you won't even notice the problem until users start complaining about it.
you don't really need a large object collection for this to happen (albeit it is more common with large objects referencing a bunch of other objects): simple example: http://3v4l.org/pqYpr
a simple snippet showing the infinite recursion with such data: http://3v4l.org/rSg42
So what do you think @Tyrael right now?
it seems fine, and I really like that you also added a test for it.
Its not me, but my friend @filipc.
Thanks Again Filip!
yeah, thanks both of you! do you have any ETA for the next tag?
How about now? :)
\o/
ok packagist is updated.
variables (mostly objects, as they are passed by ~reference by default) can have references to themselves or each other, which will cause an infinite loop when you are trying to iterate over $array in the xmlVarsFor() method. you could store and check the spl_object_hash() result for each object when iterating through the $array, and skip the building(or assign the value "RECURSION" to any other occurance to better match the print_r() behavior) of those objects which were traversed already.