PHP, beware of the Sharingan!

Do you know what Sharingan is? Yes the one from the Naruto manga/anime 😀


If not, it is basically a visual ability that let their holder (i.e. ninjas of the Uchiha clan) do a lot of creepy/cool things.

Between them there is the capability to create illusions in the minds of the victims that meet their gaze and even trap them in a total imaginary world.

Well, a few weeks ago I partially felt prey of something similar.

I was testing a PHP application (i.e. my thesis first draft) that should be able to parse PHP source code and create an in memory representation of it. During the analysis however the application died silently. No errors, no warnings…

Obviously I began to look around and after twenty minutes I discovered that I was prey of the PHP error suppression operator (i.e. @) that was hiding the error. In particular the operator was used to suppress the errors raised by the token_get_all() function utilized inside the fantastic Nikic PHP-Parser.

As I discovered this, I released myself from the illusion and discovered the problem (i.e. not enough memory to analyze a file with roughly 30K LOC).

Moral: don’t let the Sharingan (i.e. @) hypnotize you!

P.S: yes I know…@ seems more like Rinnegan! 😛

Leave a Reply