PHPDoc: Typehint in nested arrays (with e.g. 2 dimensions)

Viewed 11522

Is there a correct way to document values/objects in arrays which are within another dimension?

Normally an array will be handled like this:

/** @var ClassName[] $Array */
$Array = array( $InstanceOfClassName,.. )

But i need something like this:

/** @var ClassName[][] $Array */
$Array = array( 0 => array( $InstanceOfClassName,.. ) )

This is obviously not working, so what is the correct PHPDoc notation?

2 Answers
Related