Skip to content

Instantly share code, notes, and snippets.

@juzna
Created March 26, 2012 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juzna/2203930 to your computer and use it in GitHub Desktop.
Save juzna/2203930 to your computer and use it in GitHub Desktop.
Multidimensional arrays in PHP
<?php
class Tool {
/**
* @return Tool[][]
*/
function getItems() {
return call_user_func('x'); // dummy
}
}
$t = new Tool;
$a = $t->getItems();
$b = $a[0];
$c = $b[0];
// should be: Tool[][] $a Tool[] $b Tool $c
// PhpStorm Tool[] $a Tool $b ? $c
// NetBeans all are equal, act as both Tool[] and Tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment