|
32 | 32 | * |
33 | 33 | * 1. MUST NOT use or modify any global variable. |
34 | 34 | * 2. MIST NOT perform any IO operations, even read-only ones. |
35 | | - * 3. MUST NOT modify any property of an object provided to it as an |
| 35 | + * 3. MUST NOT modify any property of an object provided to it as an |
36 | 36 | * argument, even transitively. |
37 | | - * 4. MUST NOT read from an object property on the same object unless |
| 37 | + * 4. MUST NOT read from an object property on the same object unless |
38 | 38 | * that property is `readonly`. |
39 | 39 | * 5. MUST NOT accept a parameter by reference. |
40 | | - * 6. MUST NOT call any function that is not also marked "pure." (It |
| 40 | + * 6. MUST NOT call any function that is not also marked "pure." (It |
41 | 41 | * may invoke a callable passed to it as an explicit argument.) |
42 | 42 | * |
43 | 43 | * ## When should the attribute be applied |
|
49 | 49 | * implementations of that method MUST themselves be marked pure. |
50 | 50 | * |
51 | 51 | * Static analysis tools |
52 | | - * - SHOULD verify that the function indeed meets the rules above, |
| 52 | + * - SHOULD verify that the function indeed meets the rules above, |
53 | 53 | * and treat it as an error if not. |
54 | | - * |
55 | | - * Static analysis tools |
56 | | - * - MUST treat PHP standard library functions that conform to these |
| 54 | + * - MUST treat PHP standard library functions that conform to these |
57 | 55 | * rules as pure. As an example, `strtolower()` is pure. `sort()` |
58 | 56 | * is not. |
59 | | - * - MUST flag as an error any function that is marked pure but is |
| 57 | + * - MUST flag as an error any function that is marked pure but is |
60 | 58 | * demonstrably not. |
61 | 59 | * - MUST treat any method implementing an interface method marked |
62 | 60 | * pure as pure. |
63 | 61 | * |
64 | 62 | * Optimization tools and pre-compilation tools: |
65 | | - * - MAY implement optimizations based on the knowledge that a function |
66 | | - * is pure. For example, they may safely cache its results indefinitely, |
| 63 | + * - MAY implement optimizations based on the knowledge that a function |
| 64 | + * is pure. For example, they may safely cache its results indefinitely, |
67 | 65 | * or inline its code into another routine. |
68 | 66 | * |
69 | 67 | */ |
|
0 commit comments