Don't rely on isset to check if it is isset!

Updated: 15th June 2021
Tags: php

Php isset will tell false if variable is null.

//false
isset($a[1]);

$a[1] = null;
//false
isset($a[1]);

That's why you should use array_key_exists if you need to check if it is set or not.

//false
array_key_exists($a[1]);

$a[1] = null;
//true
array_key_exists($a[1]);