sudo apt install -y \
php8.3 \
php8.3-cli \
php8.3-common \
php8.3-mysql \
php8.3-xml \
php8.3-mbstring \
php8.3-curl \
php8.3-zip \
php8.3-bcmath \
php8.3-gd \
php8.3-intl \
php8.3-soap \
php8.3-readline \
php8.3-pgsql \
php8.3-sqlite3
update-alternatives --config phpselect 8.3- Reconfigure apache2
a2dismon php7.4 2>/dev/null || true
a2enmod php8.3
systemctl restart apache2
- You can check php_info() in some dummy file.
<VirtualHost *:80>
ServerName cetafmets.uz
DocumentRoot /var/www/html/myproject/public
<Directory /var/www/html/myproject/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
- Null coalescing - check for null and performs next (?? ??=)
- Ternary - check for false and performs next (?:)
OPcache works by storing the precompiled script bytecode in shared memory, not the original source files themselves. This eliminates the need for PHP to load, parse, and compile the human-readable code on each request, significantly boosting performance. The reason your changes to StatusMapper are not reflected immediately is that OPcache is serving the old, cached bytecode from memory.
<?php
opcache_reset();
echo "OPcache has been cleared successfully!";
?>if (is_string($hashesForCherryPick)) $hashesForCherryPick = explode(" ", $hashesForCherryPick);If you concatenate false with a string, PHP will turn it into an empty string ("").
- Functional tests only in and out. Your soft becomes black-box, it kind of user behavior simulation
- Unit tests inside of classes, how they were designed. Test component in an isolated way.
- Stubs are fake objects, thatreturns something that you expect (API response, data)
- Mocks are more advanced, they test behavior of a method (how much method was called, with what arguments, in what order)
cd ~
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
# to check
HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer -v
- We can see how it was configured in most popular open-sorce workflows. For example in https://github.com/nunomaduro/collision/actions/runs/18556937305/workflow?pr=337#L29
Or in https://github.com/pestphp/pest/actions/runs/18678438076/workflow PEST
Or in https://github.com/laravel/framework/actions/runs/19550739797/workflow?pr=57841 Laravel Framework
- Class member variables are called
properties
- Parameters: Parameters are the variables listed inside the parentheses in a function's definition. They act as placeholders for the values that will be passed into the function when it's called. Think of them as the function's "input specifications."
- Arguments: Arguments are the actual values that are passed to a function when it's called. They are the real data that the function will use during its execution. Think of them as the function's "actual inputs."
<?php
function add($num1, $num2) { // $num1 and $num2 are parameters
return $num1 + $num2;
}
$result = add(5, 3); // 5 and 3 are arguments
echo $result; // Output: 8