Since isset works with variables (my bad) and not with an arbitrary expression, you can use array_key_exists .
namespace A; class B { const X = [ 'Y' => [ 'Z' => 'value' ] ]; } var_dump(array_key_exists('Y', \A\B::X) && array_key_exists('Z', \A\B::X['Y']));
Federkun
source share