row_array()['key'] doesn't work in PHP 5.3

前端 未结 1 1526
有刺的猬
有刺的猬 2021-01-24 12:40

Am I right that the following syntax works in PHP 5.4 but doesn\'t work in PHP 5.3?

$users[$key][\'class\'] = $class->row_array()[\'name\'];

相关标签:
1条回答
  • 2021-01-24 12:57

    Array dereferencing has been introduced in PHP5.4

    As of PHP 5.4 it is possible to array dereference the result of a function or method call directly. Before it was only possible using a temporary variable.

    http://php.net/manual/en/language.types.array.php

    0 讨论(0)
提交回复
热议问题