Automatic deployment to Hostinger from GitHub
How to publish a site to Hostinger automatically from a GitHub repository: Git deployment in hPanel, a webhook, a GitHub Actions build and keeping secrets safe.

PHP is one of the most popular programming languages for web development. Since its creation in 1994, it has come a long way, evolving from a simple tool for dynamic web pages into a powerful, high-performance, and versatile programming language. Let us look at the main stages of its development and discuss in detail the key changes in versions 8.0, 8.1, 8.2, and 8.3.
PHP was created by Danish programmer Rasmus Lerdorf in 1994 as a set of Perl scripts to track visits to his résumé on a website. In 1995, he released the first version of PHP/FI (Personal Home Page/Forms Interpreter), supporting HTML forms and database interaction.
With the help of Zeev Suraski and Andi Gutmans, PHP was completely rewritten, leading to the release of PHP 3.0 in 1998. It introduced the new Zend Engine, which significantly improved the language’s performance and flexibility. PHP 3 became the first widely used version of the language to support object-oriented programming.
PHP 4 with Zend Engine 1.0 was released in 2000, offering improved performance and session support, making PHP better suited for building complex dynamic web applications.
PHP 5, released in 2004, introduced full support for object-oriented programming, improved database interaction through PDO (PHP Data Objects), and a new exception handling model.
In 2015, PHP 7.0 introduced the next-generation Zend Engine 3.0, doubling code execution speed and adding support for typing function arguments and return values.
PHP 8.0, released in November 2020, was an important step forward thanks to many new features and improvements that made the language more convenient, performant, and expressive. The key innovations include:
The JIT compiler makes it possible to dynamically compile part of the bytecode into machine code at runtime. This is particularly useful for computationally intensive tasks, such as scientific computing or machine learning. However, JIT has less impact on typical web applications.
Example:
<?php
function fibonacci($n) {
if ($n == 0) return 0;
if ($n == 1) return 1;
return fibonacci($n-1) + fibonacci($n-2);
}
echo fibonacci(30);
?>
match is an improved version of the switch statement that uses strict typing, does not require break statements, and can return a result directly.
An example of using match:
<?php
$status = 404;
$message = match ($status) {
200 => 'OK',
404 => 'Not Found',
500 => 'Internal Server Error',
default => 'Unknown Status',
};
echo $message; // Выведет: Not Found
?>
Named arguments make it possible to pass function parameters by name, making function calls clearer and more convenient.
Example:
<?php
function greet(string $name, string $greeting = 'Hello') {
echo "$greeting, $name!";
}
greet(name: 'John', greeting: 'Welcome'); // Выведет: Welcome, John!
?>
Union types allow you to specify multiple types for arguments and return values.
Example:
<?php
function processInput(int|string $input) {
if (is_int($input)) {
return $input * 2;
} else {
return strtoupper($input);
}
}
echo processInput(10); // Выведет: 20
echo processInput('hello'); // Выведет: HELLO
?>
This feature makes it possible to automatically assign object properties from constructor arguments, reducing the amount of code.
Example:
<?php
class Point {
public function __construct(
public int $x,
public int $y
) {}
}
$point = new Point(3, 5);
echo $point->x; // Выведет: 3
?>
PHP 8 generates errors when accessing non-existent array keys or object properties, improving code reliability.
Example:
<?php
$data = [];
echo $data['key']; // Fatal Error: Uncaught Error: Undefined array key "key"
?>
PHP 8.1, released in November 2021, added many important features and improvements, such as enums, fibers, and readonly properties.
Enums (enum) make it possible to define a fixed set of values used in code.
Example:
<?php
enum Status {
case Pending;
case Completed;
case Failed;
}
function handleStatus(Status $status) {
return match ($status) {
Status::Pending => 'Pending',
Status::Completed => 'Completed',
Status::Failed => 'Failed',
};
}
echo handleStatus(Status::Pending); // Выведет: Pending
?>
Fibers add the ability to create cooperative threads in PHP, simplifying asynchronous programming.
Example:
<?php
$fiber = new Fiber(function() {
$value = Fiber::suspend('fiber suspended');
echo "Resumed: $value\n";
});
echo $fiber->start(); // Выведет: fiber suspended
$fiber->resume('resume value'); // Выведет: Resumed: resume value
?>
readonly properties can be initialized only when an object is created, after which they become immutable.
Example:
<?php
class User {
public readonly string $name;
public function __construct(string $name) {
$this->name = $name;
}
}
$user = new User('Alice');
// $user->name = 'Bob'; // Ошибка, так как свойство readonly
?>
PHP 8.2, released in December 2022, brought further syntax improvements and new features.
PHP 8.2 allows classes to be declared as readonly, which automatically makes all their properties immutable.
Example:
<?php
readonly class Product {
public function __construct(
public string $name,
public float $price
) {}
}
$product = new Product('Laptop', 1200.00);
// $product->price = 1300.00; // Ошибка, так как класс readonly
?>
Dynamic properties created outside a class declaration are now deprecated, which helps prevent errors.
Example:
<?php
class User {}
$user = new User();
$user->name = 'John'; // Deprecated: dynamic properties are deprecated
?>
You can now specify null, false, and true as types in union types.
Example:
<?php
function test(null|false|string $value): string {
return $value === null ? 'null' : ($value === false ? 'false' : $value);
}
echo test(null); // Выведет: null
echo test(false); // Выведет: false
echo test('test'); // Выведет: test
?>
PHP 8.3, released in November 2023, continued to improve the language with a focus on enhancing security and adding new useful features.
A new json_validate function has been added, allowing you to check whether a JSON string is valid without decoding it.
Example:
<?php
$json = '{"name": "John", "age": 30}';
$is_valid = json_validate($json);
echo $is_valid ? 'Valid JSON' : 'Invalid JSON';
?>
You can now declare types for constants within classes, strengthening type safety.
Example:
<?php
class Config {
public const string NAME = 'Application';
}
echo Config::NAME; // Выведет: Application
?>
PHP 8.0 and later versions have brought many improvements that significantly enhanced the language’s performance and expressiveness. From JIT compilation and innovations such as match, union types, and fibers to the latest improvements in PHP 8.3, the language continues to evolve and adapt to the requirements of modern web applications, remaining a key tool for millions of developers around the world.
I have great news for all my subscribers! 🎉 When paying for JetBrains products, you can use the special promo code “Asgru24” and get a 25% discount on any product! Don’t miss the opportunity to save on the best development tools.
Need help with this?
Updating PHP for WordPress safely: theme and plugin compatibility check, code fixes and the move to PHP 8.x without downtime. From €60.
More about the service →
Local machine → repository → server: you ask, an AI agent changes the site, every change is reviewed, saved and deployed automatically. I set it up and teach your team.
How it works →

How to publish a site to Hostinger automatically from a GitHub repository: Git deployment in hPanel, a webhook, a GitHub Actions build and keeping secrets safe.

Two ways to put a WordPress site under Git: keep the theme and plugins in a repository, or export the content into a static site. What to commit and how to deploy.

How managing a website through an AI coding agent works: what to prepare, the cycle from request to publishing, and which tasks to trust an agent with.

Contact
An AI agent, an automation, a website improvement or a full rebuild — describe the task in a few lines and I will reply within one business day.
Tallinn, Estonia · working remotely across Europe
The site does not use cookies. Visit statistics are collected without them. Learn more