is_null vs "$var === null

Why PhpStorm' inspection suggests using "$var === null" construction instead of simply using is_null() function?

0
1 comment

Hi there,

This inspection is provided by 3rd party Php Inspections (EA Extended) plugin and not by PhpStorm itself.

As to why -- it's a tiny bit faster/micro optimisation (as not function call is involved; need to measure few thousand if not hundred thousand times), not so much these days.

Check https://stackoverflow.com/questions/8228837/is-nullx-vs-x-null-in-php or linked questions.

0

Please sign in to leave a comment.