You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wordpress-coding-standards/php.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ Note that requiring the use of braces just means that _single-statement inline c
127
127
128
128
### Use `elseif`, not `else if`
129
129
130
-
`else if` is not compatible with the colon syntax for`if|elseif` blocks.For this reason,use `elseif`for conditionals.
130
+
`else if` is not compatible with the colon syntax for`if|elseif` blocks.For this reason,use `elseif`for conditionals.
131
131
132
132
### Declaring Arrays
133
133
@@ -582,9 +582,9 @@ While this operator does exist in Core, it is often used lazily instead of doing
582
582
583
583
### Don't `extract()`
584
584
585
-
Per[#22400](https://core.trac.wordpress.org/ticket/22400"Remove all, or at least most, uses of extract() within WordPress"):
585
+
Per[#22400](https://core.trac.wordpress.org/ticket/22400"Remove all, or at least most, uses of extract() within WordPress"):
586
586
587
-
> `extract()`is a terrible function that makes code harder to debug and harder to understand. We should discourage it's [sic] use and remove all of our uses of it.
587
+
> `extract()`is a terrible function that makes code harder to debug and harder to understand. We should discourage it's [sic] use and remove all of our uses of it.
588
588
589
589
590
590
Joseph Scott has [a good write-up of why it's bad](https://blog.josephscott.org/2009/02/05/i-dont-like-phps-extract-function/).
@@ -598,4 +598,4 @@ Joseph Scott has [a good write-up of why it's bad](https://blog.josephscott.org/
598
598
- November 13, 2013: [Braces should always be used, even when they are optional](https://make.wordpress.org/core/2013/11/13/proposed-coding-standards-change-always-require-braces/)
599
599
- June 20, 2014: Add (#error-control-operator) to discourage use of the [error control operator]((https://www.php.net/manual/en/language.operators.errorcontrol.php)) (`@`). See [#wordpress-dev](https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2014-06-20&sort=asc#m873356).
600
600
- October 20, 2014: Update brace usage to indicate that the alternate syntax for control structures is allowed, even encouraged. It is single-line inline control structures that are forbidden.
601
-
- January 21, 2014: Add section to forbidextract().
601
+
- January 21, 2014: Add section to forbidextract().
0 commit comments