Название: PHP Handbook Автор: Flavio Copes Издательство: Independently published Год: 2023 Страниц: 97 Язык: английский Формат: pdf Размер: 10.1 MB
The PHP Handbook follows the 80/20 rule: learn in 20% of the time the 80% of a topic. In particular, the goal is to get you up to speed quickly with PHP.
PHP is an incredibly popular programming language. Statistics say it’s used by 80% of all websites. It’s the language used by WordPress, the widely used content management system for websites. And it powers a lot of different frameworks that make Web Development easier, like Laravel. Speaking of Laravel, that might be the one reason to learn PHP these days. PHP is a very polarizing language. Some people love it, some people hate it. If we move one step above the emotions and we look at the language as a tool, PHP has a lot to offer. Sure it’s not perfect. But let me tell you no language is perfect. In this handbook, I’m going to help you learn PHP. This book is a perfect introduction if you’re new to the language. It’s also perfect if you’ve done “some PHP” in the past and you want to get back to it. I’ll explain modern PHP, version 8+. PHP has evolved a lot in the last few years and if the last time you tried it was PHP 5 or even PHP 4, you’d be surprised at all the good things that PHP now offers.
PHP is often called a “scripting language” and it’s an interpreted language. If you’ve used compiled languages like C or Go or Swift, the main difference is that you don’t need to compile a PHP program before you run it. The PHP interpreter is responsible for interpreting the instructions written in a PHP program when it’s executed. It’s just one step. You tell the interpreter to run the program. A completely different workflow. PHP is a dynamically typed language. The types of variables are checked at runtime, rather than before the code is executed as it happens for statically typed languages (which also happen to be compiled, the two characteristics often go hand in hand). PHP is also loosely (weakly) typed. Compared to strongly typed languages like Swift, Go, C or Java, you don’t need to declare the types of your variables.
Fun fact: PHP is written, internally, in C, a compiled and statically typed language. In its nature, PHP is similar to jаvascript, another dynamically typed, loosely typed and interpreted language. PHP supports object-oriented programming, and also functional programming. You can use it as you prefer.