How in terms of a PSR to write "&"?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
16 views
Don't see the standards guidelines for writing the ampersand.

foreach ($dataSource as & $item) { }

How to write:
& $item
or
&$item
by | 16 views

1 Answer

0 like 0 dislike
Here psr https://github.com/php-fig/fig-standards/blob/mast...

Paragraph 4.4

A method declaration looks like the following. Note the placement of parentheses, commas, spaces, and braces:
<?php\r\rnamespace Vendor\\Package;\r\rclass ClassName\r{\rpublic function fooBarBaz($arg1, &$arg2, $arg3 = [])\r{\r// method body\r}\r}</code>
by
110,608 questions
257,186 answers
0 comments
35,406 users