skolodyazhnyy / json-stream

JSON stream reader, writer and parser
MIT License
63 stars 10 forks source link

Fix memory leak for objects with numeric keys #14

Closed hotrush closed 5 years ago

hotrush commented 5 years ago

Reference https://github.com/skolodyazhnyy/json-stream/issues/12

skolodyazhnyy commented 5 years ago

Could you explain the fix a bit?

hotrush commented 5 years ago

Hi, you can check this issue https://github.com/skolodyazhnyy/json-stream/issues/12 for problem explanation .

enter method mix string object key "1" with const CONTEXT_OBJECT = 1. Look at xdebug output attached

peek 2018-11-27 13-19

skolodyazhnyy commented 5 years ago

Got it, I guess API is far from perfect here as $key sometimes is used as type. Your fix makes sense, thanks for contribution.