Created
March 26, 2012 08:38
-
-
Save juzna/2203930 to your computer and use it in GitHub Desktop.
Multidimensional arrays in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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