Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
allworldit
allworldit
Commits
1c668429
Commit
1c668429
authored
Sep 08, 2014
by
Charl
Browse files
Added Markup Fixes
parent
409dfc83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Languages/PHP.md
View file @
1c668429
...
...
@@ -413,7 +413,7 @@ In the argument list and variable list, there MUST NOT be a space before each co
Closure arguments with default values MUST go at the end of the argument list.
A closure declaration looks like the following. Note the placement of parentheses, commas, spaces, and braces:
```
php
<?php
$closureWithArgs
=
function
(
$arg1
,
$arg2
)
{
// body
...
...
@@ -422,6 +422,8 @@ $closureWithArgs = function ($arg1, $arg2) {
$closureWithArgsAndVars
=
function
(
$arg1
,
$arg2
)
use
(
$var1
,
$var2
)
{
// body
};
```
Argument lists and variable lists MAY be split across multiple lines, where each subsequent line is indented once.
When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument or variable per line.
...
...
@@ -479,6 +481,7 @@ $shortArgs_longVars = function ($arg) use (
```
Note that the formatting rules also apply when the closure is used directly in a function or method call as an argument.
Example...
```
php
<?php
...
...
@@ -593,8 +596,6 @@ use Vendor\Package\ClassName;
// rest of PHP code
```
###
## 99. End Of File
To make life easier with tabs, files must contain
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment