# PHP
- [psysh](#what-is-physh-?)
- [php compiled or interpreted ?](#php-compiled-or-interpreted-?)
- [what is PHP-FIG ?](#php-fig)
- [what is PSR](#what-is-psr-?)
- [unit testing ](#PHPUnit)
- [All about php versions](#All-about-php-versions)
- OOP in php
- OOD in php
- observer
- factory
- provider
- repository
- adapter
- bridge
- state
- statergy
- Array
- String
- Magic methods
- [SOLID Principle in php](#php-solid-principle)
- [php vs java](#php-vs-java)
## what is psysh ?
> psysh is a REPL for php like ipython for python
## PHP-FIG
> PHP-FIG stands for PHP *Framewor Interop Group*
>
> it is a consontium formed by members from the biggest PHP projects frameworks and cms
>
> for long php had no coding style . PHP-FIG proposes a single unity of code saying "Let’s stop worrying about code style, let’s everyone follow a standard and start thinking about creating great software"
## what is psr ?
> PSR stands for *php standard recomendation* and is proposed by [php-fig](#php-fig)
>
> these standards propose the modern PHP coding style
## PHPUnit
> for unit testing php unit is used , it is a porgrammer oriented testing framework for php
>
> It is an instance of the xUnit architecture for unit testing frameworks.
>
> xUnit is the collective name for several unit testing frameworks
## All about php versions
#### what is the difference between php7 and php5 ?
## php solid principle
| A | B |
|---|---|
| C | D |
### reference
* https://github.com/aistiak/solid-principles
## php vs java
### reference
* https://medium.com/@alexkatrompas/java-will-kill-your-startup-php-will-save-it-f3051968145d
## php compiled or interpreted ?
> ### php is interpreted but ,php is compiled down to an intermidiate code that is then interpreted by the runtime zend engine
__PHP compiler is responsible for__
> * convert the code to a bytecode that can be used by the runtime engine.
> * resolve functions, names and classes names
> * creating a symbol table
**PHP Interpreter does**
> * Goes through the bytecode line by line and executes it
> * Handles runtime exception
### common terms
> __expression__ something that resolves to a vlaue.
__statement__ is a command given to the computer .
__compiler__ compiler translates high level source code into a set of machine instructions that could be understood by the computer CPU .
__interpreter__ the code of interpreted language
must be translated at run time from any format to cpu machine code one statement at a time .
### reference
* https://www.geeksforgeeks.org/php-5-vs-php-7/