We are going to talk about
- Where is it heading to.
- What to learn?
- Which framework to choose next?
Let's start with
Overall PHP usage and popularity declines to some degree but it is still one of the most popular languages.
Where is PHP heading to?
But first a bit about languages in general
What's the difference between languages?
There are almost no all-stars IT-teams when it comes to real business. You need a language for novices.
- Frames (guidelines, limitations).
- Java is for novices.
- Python is for experienced.
Features are less important
We're more assembling rather than developing except domain.
Do it as golang micro-service.
- More exceptions.
- Return types and scalar typehints.
- phpdoc is always cached (annotations).
- nullable types.
- void return.
- Constant visibility (private, protected, public).
- object as typehint.
- More security.
- Syntactic sugar.
- Syntactic sugar.
- Syntactic sugar.
- Typed properties.
- Improved type variance.
- Somewhere between "for novice" and "for fun".
- Frameworks could shift above position.
- Teamleads and tools are watching.
- Allows prototyping fast.
- Infrastructure is great! Composer.
- Stateless by default.
- Good for domain.
What to learn?
Learn what you can use anywhere
- OOP/OOD. Check yourself with cohesion/coupling.
- CAP (Consistency-Availability-Partition Tolerance).
- Basic understanding of algorithm complexity.
You still should learn the framework you use!
Business needs more than that...
- Adequate cost.
- Ability to express yourself clearly.
- Ability to write dirty code quickly.
- Ability to estimate.
- Desire to learn new things.
Which framework to choose next?
- Yii 2.
- Zend Framework.
- Slim, F3, ...
- Best marketing. Most popular framework nowadays.
- Secret priorities similar to Apple.
- Questionable community relations.
- It's mostly alright.
- Strong limitations.
- Performance issues are being solved by caching and compiling (extreme case - OroCRM).
- It better if cache works well. Debug isn't easy sometimes. There are many layers.
- Style is similar to Java and Spring.
- Since recently following Laravel features :(
Similar to Symfony but with different style.
Becoming Laminas soon.
- Way better perforance.
- Can't dig into it easily. It is PECL.
Great for async daemons.
If you want a web-site...
Some studios create their own CMS with frameworks.
What do you really need from a framework?
What about no framework approach?
Do you have enough experience and time?
- You'll build a framework anyway.
- Each library is OK by itself but how about 10 libraries used together?
- How to teach your team?
- Deadlines... yesterday?
Try it. We succeeded in making a framework ;)
Don't get stuck with a single language or framework
- PHP MVC.
- Rapid development.
- You can get from MVP to support and development.
- Lots of features out of the box.
- Flexible and pragmatic.
- Allows taking shortcuts.
Originally created by Qiang Xue in 2008 based on his Prado framework (2004).
Yii 2 was released in 2014.
- Slack, 1500 users.
- 500 projects at YiiPowered.
- 12852 Github stars.
- 31767 Facebook group members.
- High Performance
- Sensible Defaults and Flexibility
- Be practice-oriented
- Be simple
- Be explicit
- Be consistent
Same as with every framework Yii has its pros and cons.
- Not too strict
- Thin abstractions, sequential, good naming. Easy to read and debug.
- Performance. Works great without cache.
- Grids and data providers
Tried to handle too much
Got too much into the core.
- Masked input.
- More clientside :(
Tried to fix PHP with magic.
We haven't used many PSRs
They were mostly accepted after framework release. Backwards compatibility...
- Set of packages (log, di, i18n etc.) + default application.
- Allow both "classic" MVC and DDD.
- SOLID, GRASP etc.
- PSRs (HTTP request/response, middlewares, container, events).
- Strict types.
- Keep most good things from Yii 2.
- Kill most of inheritance
- Swoole / RoadRunner