PHP PSR PSR-1: Basic Coding Standard

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

PSR-1 is an accepted recommendation and outlines a basic standard recommendation for how code should be written.

  • It outlines naming convetions for classes, methods and constants.
  • It makes adopting PSR-0 or PSR-4 recommendations a requirement.
  • It indicates which PHP tags to use: <?php and <?= but not <?.
  • It specifies what file encoding to use (UTF8).
  • It also states that files should either declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or execute logic with side effects and not define symbols, but do both.


Got any PHP Question?