<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>The system for testing diferent versions of the PHP</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mariia Yu. Tiahunova</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Halyna H. Kyrychek</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yevhenii D. Turianskyi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>National University “Zaporizhzhia Polytechnic”</institution>
          ,
          <addr-line>64 Zhukovskyi Str., Zaporizhzhia, 69063</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <fpage>112</fpage>
      <lpage>129</lpage>
      <abstract>
        <p>The paper analyzes various versions of the popular PHP programming language. It is used in web development and there are many popular website engines and frameworks written in PHP. Many new and useful features of PHP 8, such as JIT compiler, error correction, etc., are described, which are useful for both users and developers. A testing system has been developed for diferent versions of PHP, which can be extended by other modules if necessary. The result of the system is time data reflecting the speed of the selected PHP version.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;PHP</kwd>
        <kwd>programming languages</kwd>
        <kwd>testing system</kwd>
        <kwd>speed</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Nowadays, there are many programming languages such as JavaScript, goLang, Java, etc. They
are diferent in purpose thus their use is also limited. When we talk about web development
languages, we can’t mention PHP.</p>
      <p>
        PHP is a widely used language for web implementations, which occupies more than 78% of
the market for server solutions [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Its development began back in 1994 by Rasmus Lerdorf as a
“Personal Home Page” for his own use and has continued to grow ever since [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>PHP is an open source language, meaning users can modify or modify it. It can be used and
distributed to other users and organizations.</p>
      <p>PHP’s syntax is similar to C. Elements such as associative arrays and the foreach loop are
borrowed from Perl. The execution of the program does not require the description of variables,
modules, or etc, but this language supports OOP (fully from version 5). The program begins
with the operator &lt;?php, which indicates the start of script execution. There is also a shortened
version to output the string &lt;?=. Execution ends with the ?&gt; operator, but if the entire file
consists only of PHP code, then you do not need to use the closing operator.</p>
      <p>Variable names begin with the $ character, without specifying the type of the variable itself,
and are case sensitive.</p>
      <p>When comparing PHP to JavaScript and its newer server-side implementations, PHP still
comes out on top. PHP is interpreted by the web server into HTML code, which is transmitted
to the client side. Unlike JavaScript, the user does not have access to the PHP code, which is an
advantage from a security point of view, but significantly impairs the interactivity of the pages.
However, nothing prohibits the use of PHP to generate JavaScript code that will be executed on
the client side.</p>
      <p>Many features are built into PHP that make it possible not to write them multi-line like in C
or Pascal. There are libraries for working with many databases, such as MySQL, PostgreSQL,
mSQL, Oracle, dbm, Hyperware, Informix, InterBase, Sybase, etc.</p>
      <p>
        There is also the PHP Data Object – PDO module, which provides a simple and consistent
interface for accessing databases, which has many methods for using databases and protection
against SQL injections [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>The attribute syntax consists of several parts. First, an attribute declaration always begins
with the #[and ends]. Inside an enumeration of one or more comma-separated attributes.
Attributes can be specified using partial, full, and absolute names.</p>
      <p>Attribute arguments are optional, but if present, they are enclosed in braces (). Attribute
arguments can be either specific values or constant expressions. Both positional and named
argument syntax can be used for arguments. When an attribute is requested using the Reflection
API, its name is interpreted as a class name, and arguments are passed to its constructor. Thus,
for each attribute there must be a corresponding class.</p>
      <p>
        However, there is a big problem with the PHP community. Many websites are still using
outdated and no longer supported versions of PHP. According to W3Techs [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], 38.8% of websites
still run on PHP 5.6 and below leading to worse performance, no security breach closing support
releases and not having newly added functionality that can provide necessary improvements
out of the box. The point of this article is to show the speed diferences between the PHP
versions as an additional argument to developer to upgrade and support existing web products.
      </p>
      <p>This is achieved in work by developing a system, with the help of the results of which
determine the most productive version of PHP among the specified ones. To achieve this the
following tasks must be completed:
• analyze the features of diferent versions PHP;
• design a performance analysis system;
• select mathematical and other operations for performance research;
• implement the system;
• analyze the performance of PHP of diferent versions on selected operations and visualize
the obtained results;
• analyze the obtained results.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Language versions and their features</title>
      <p>The keyword class was reserved even in the third version of the language, in the fourth it
was already possible to create classes and objects of these classes. Nevertheless, until the fifth
version, the principles of OOP were not fully implemented, since all methods and properties
were open privacy and were not a cheap wish on the part of the runtime.</p>
      <p>
        The use of classes in PHP is similar to C, a class is declared by the keyword class, it can
have properties and methods of a certain privacy, namely public, which are available from
anywhere, protected, which the class itself and its successors have access to, and private, which
are not no one has access except the class itself. PHP supports all OOP mechanisms such as
encapsulation, polymorphism, and inheritance. Also the use of such keywords as final, abstract,
extend, implement [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Any class can have many interfaces that it implements, but can inherit only one of the classes.
To solve this problem, version 5.4.0 introduced a code reuse mechanism called trait. Many traits
can be used in a class using the use word, but it is not possible to get a trait object. At runtime,
the trait’s code will be “mounted” to the class that uses it.</p>
      <p>
        PHP 5 [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] was released back in 2004 and runs on the new Zend Engine II. The Zend engine
is a set of components that make PHP. The most important component of Zend is the Zend
Virtual Machine, which includes the Zend Compiler and Zend Executor components. We can
also add the OPCache zend extension to the same category. These three components are the
core of PHP, they are the critical and most complex parts of the source code. The Zend engine
behind the interpreter has been completely redesigned in Zend Engine 2, paving the way for
further improvements. PHP 5 included new features such as improved OOP support, PHP data
objects, also known as PDO extensions (a lightweight and consistent database access interface),
and much more.
      </p>
      <p>Starting with PHP 8.0.0, constructor parameters can be used to set the appropriate properties
of an object. It is a fairly common practice to give object properties the parameters passed to the
constructor without doing any additional transformations. In this case, defining the properties
of the class in the constructor allows you to significantly reduce the amount of template code.</p>
      <p>Starting with PHP 8.0.0, properties and methods can also be accessed using the “nullsafe”
operator: ?-&gt;. The nullsafe operator works in the same way as a property or method access,
except that if the variable that contained an object of class actually returns null, then null is
returned instead of an exception being thrown. If the dereference is part of a string, the rest of
the string is skipped. Similar to the conclusion of each call in is_null(), but more compact.</p>
      <p>Performance improvements continued: the hash table (PHP’s main data structure) was
optimized, specialization of certain opcodes in the Zend VM and specialization of certain sequences
in the compiler were implemented, the optimizer (OpCache component) was continuously
improved, and many other changes were made.</p>
      <p>
        According to PHP developer Dmytro Stogov: “JIT is extremely simple, but in any case it
increases the level of complexity of PHP, the risk of new bugs appearing, and the cost of
development and maintenance” [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The proposal to introduce JIT to PHP 8 received 50 votes
out of 52 [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. A short list of additional approved improvements that are included in PHP 8 is
given in Zandstra [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], Prettyman [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        To carry out complex testing, it is necessary to develop a system that would perform operations
that require only one computer resource. These components are the CPU and hard disk. The
results of the tests will be time indicators, by which it will be possible to compare diferent
versions of the PHP language. Accordingly, shorter execution time is better [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Development of a testing system</title>
      <sec id="sec-3-1">
        <title>3.1. Choosing a web server</title>
        <p>To implement the system as a web page, it is necessary to have a web server that would perform
the necessary actions on a request by URL address.</p>
        <p>Apache and Nginx were considered among the local servers. These are the two most common
open source web servers in the world. Together, they serve more than 50% of the world’s
trafic. Both solutions are able to work with diferent work programs and interact with other
applications to implement a complete web stack. Although Apache and Nginx have many
similar qualities, they cannot be considered as completely interchangeable solutions, as each
has its own capabilities.</p>
        <p>
          Apache provides several multi-processing modules (MPM), which are responsible for how
the client’s request will be processed. This allows administrators to define connection handling
policies [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
        </p>
        <p>Nginx came later than Apache, so its developer was more aware of the competitive issues
that sites face when scaling. Thanks to this knowledge, Nginx was originally designed based on
asynchronous non-blocking event-driven algorithms. Nginx creates worker processes, each of
which can serve thousands of connections. Workers achieve this result thanks to a mechanism
based on a fast cycle in which events are checked and processed. Separating the main work
from connection processing allows each Worker to do its job and be distracted from connection
processing only when a new event occurs.</p>
        <p>
          Looking at real-life examples, the main diferences between Apache and Nginx are how they
handle requests to static and dynamic content. Apache can serve static content using standard
ifle-based methods. Productivity of such operations depends on the selected MPM [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>Nginx does not have the ability to handle dynamic content requests on its own. To handle
requests to PHP or other dynamic content, Nginx must pass the request to an external processor
for execution, wait for the response to be generated, and receive it. The result can then be sent
to the client.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. System design</title>
        <p>To test diferent versions of PHP, it is necessary to implement a system that includes classes
that would present each type of test.</p>
        <p>The following image (figure 1) shows a visual representation of the basic PHP execution
process.</p>
        <p>
          PHP execution is a 4-step process [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]:
• lexing/tokenization – the interpreter reads the code and creates a set of tokens;
• parsing – the interpreter checks whether the script matches the syntax and uses tokens
to build an abstract syntax tree, a hierarchical representation of the PHP source code
structure;
• compilation – the interpreter traverses the tree and translates the AST nodes into
lowlevel Zend opcodes, which are numeric identifiers that define the types of instructions
executed by the Zend virtual machine;
        </p>
        <p>• interpretation – opcodes are interpreted and run on the Zend VM.</p>
        <p>OPcache improves PHP performance by storing precompiled script bytes in shared memory,
eliminating the need to load and parse PHP scripts for each request (figure 2).</p>
        <p>The project does not require any frameworks. Structurally, the project will consist of a
configuration file, a class for each module to be tested, a class for displaying results on the
screen, and an executable file – the starting point.</p>
        <p>
          The script can be called both from the console and as a web page. Calling the initial file will
in turn call an object of the Benchmark class, which starts the initialization of information about
the enabled modules for testing. Next, all the modules will be performed one by one with the
output of the results of their work [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ].
        </p>
        <p>To implement the project and meet the need for future scaling, we will broadly plan the
project tree. It will consist of a configuration directory, modules, and the home classes for those
modules.</p>
        <p>First in line is the configuration file. It contains input data about the requested modules to
be executed, as well as parameters to them. In this way, we can enable, disable or expand the
functionality of the project without changing the existing code. Those modules considered to
be CPU and Disk operations since they are considered as heavy one’s and access to which was
changed from version to version of PHP.</p>
        <p>Among the functions there were selected 12 math operations and 12 string conversions.</p>
        <p>Those are abs, acos, asin, atan, bindec, floor, exp, sin, tan, is_finite, is_nan, sqrt for math and
addslashes, chunk_split, metaphone, strip_tags, md5, sha1, strtoupper, strtolower, strrev, strlen,
soundex and ord for string conversion.</p>
        <p>The next section is the directory of the actual project. The first owned folder contains the
Conifg class, which is responsible for receiving from it the data obtained from the YamlConfigLoader
– the configuration file parsing class.</p>
        <p>The following directory contains helper classes for system operation, such as:
• Directory – creates a temporary directory during tests of writing files to disk and deletes
them after the test;
• Size – contains information about file weight units, as well as byte and format conversion
methods;
• Table – exists for the generating table borders for the presentation view;
• Utility – implements the function of dynamically adding an argument for variable SQL
operations;
• Visual – a separate class designed to display information with a line separator parameter.
The following directory contains the modules that will be executed, namely:
• CPU – contains the logic of performing arithmetic operations, converting lines, calculating
the execution time of cycles and if-else expressions.
• Disk – creates files of a given weight, writes them to a temporary directory and deletes
them after time measurements.
• MySQL – a class for implementing and calculating the execution time of a random
operation.</p>
        <p>• PHP – providing information about the version of PHP.</p>
        <p>Among the functions that will be executed by the CPU are such string conversion functions
as: addslashes, chunk_split, metaphone, strip_tags, md5, sha1, strtoupper, strtolower, strrev,
strlen, soundex, ord.</p>
        <p>Among the functions that will be performed by the CPU are such mathematical functions as:
abs, acos, asin, atan, bindec, floor, exp, sin, tan, is_finite, is_nan, sqrt.</p>
        <p>The features identified are chosen because of their prevalence of use among their categories.</p>
        <p>The following file volumes were written to disk: 512, 1024, 2048, 4096, 8192, 16384, 32678,
65536.</p>
        <p>Next is the Benchmark class, which includes all the modules and starts their execution.
In the root directory there is a file – the starting point for performing all tasks.</p>
        <p>
          To use the project, you need to have an installed Composer – the application level package
manager for PHP. With its help, we can use ready-made package solutions, so as not to implement
them ourselves from scratch [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ].
        </p>
        <p>All defined packages, after they are requested by the composer, are placed in the vendor
directory, which should not be added to Git commits, since the vendor folder can weigh
many gigabytes. To work around this flaw, composer generates a composer.json file and a
composer.lock file.</p>
        <p>Json contains project dependencies for execution and is converted to a lock file, which is
actually executed by the composer. Thus, only one file is needed to “transfer” the vendor, after
cloning, or whatever, the project, we will only need to execute composer install and we will get
all the dependencies to our local project.</p>
        <p>You can get the results either by executing the benchmark.php file in the terminal as php
benchmark.php, or by running a local server, on the web page of which we will see the same
results – php -S localhost:8000 benchmark.php.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Implementation of the designed system</title>
      <sec id="sec-4-1">
        <title>4.1. Project tree</title>
        <p>The project tree looks like this (figure 3):</p>
        <p>Since an OOP approach was chosen for the implementation, all files are located according to
their purpose and have namespaces to uniquely define each class.</p>
        <p>The configuration file has the following structure (figure 4). It allows us to define each
module’s parameters such as:
• Enabled – defines whether the module will be used during the benchmark;
• Disk cycles – the amount of read/write operations;
• CPU math/strings/loops/ifElse count – the amount of recurring operations;
• MySQL – describes the access to the database, it’s name and amount of allowed operations.</p>
        <p>As you can see, we can set the number of repetitions of each operation, enable or disable any
module, and set database connection options.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Implementation of classes</title>
        <p>The Config class has several methods, but the main one is constructor initialization.</p>
        <p>Initialization of the constructor of the Config class:
public function __construct() {
$locator = new FileLocator([</p>
        <p>__DIR__ . DS . ’..’ . DS . ’..’ . DS . $this-&gt;directory
]);
try {
$loader = new YamlConfigLoader($locator);
$this-&gt;config = $loader-&gt;load(</p>
        <p>$locator-&gt;locate($this-&gt;file)
);
} catch (\Exception $e) {
Visual::print($this-&gt;file . ’ could not be loaded, please copy
’ . $this-&gt;directory . ’/config.yml.example to ’ .
$this-&gt;directory . ’/’ . $this-&gt;file);
}</p>
        <p>The result of this method is an object of the Config class with certain properties obtained
using the YamlConfigLoader. The properties of this class will be used many times in the future.</p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Implementation of mathematical operations</title>
        <p>Next, the modules and their supporting classes should be implemented. The first module is the
CPU. In order not to implement all mathematical functions manually, they can be called in a
loop. The implementation of mathematical operations is given below.</p>
        <p>Method of execution of mathematical functions:
private function math(): void {
foreach (self::$mathFunctions as $function) {
$this-&gt;mathResults[’x’][$function] = 0;
$start = \microtime(true);
for ($i = 0; $i &lt; $this-&gt;mathCount; $i++) {</p>
        <p>\call_user_func_array($function, array($i));
}
$this-&gt;mathResults[’x’][$function] +=</p>
        <p>(\microtime(true) - $start);
}
}
}</p>
        <p>As a result of its execution, we will receive an array with the names of operations and their
time indicators. The same goes for string conversion functions.</p>
        <p>Method for performing string conversion functions:
private function strings(): void {
foreach (self::$stringFunctions as $function) {
$this-&gt;stringsResults[’x’][$function] = 0;
$start = \microtime(true);
for ($i = 0; $i &lt; $this-&gt;stringsCount; $i++) {</p>
        <p>\call_user_func_array($function, array(self::$string));
}
$this-&gt;stringsResults[’x’][$function] +=
There are also separate implementations for checking loops and logical operators.</p>
        <p>Method for checking the speed of cycles:
private function loops(): void {
$start = \microtime(true);
for ($i = 0; $i &lt; $this-&gt;loopsCount; ++$i);
for ($i = 0; $i &lt; $this-&gt;loopsCount; ++$i);
$this-&gt;loopsResults = (\microtime(true) - $start);</p>
        <p>The speed test method of the IfElse statement:
private function ifElse(): void {
$start = \microtime(true);
As a result of their execution, we will receive their results as properties of the CPU class.
The next module is Disk. It contains a list of weights for the files being created.
A property of the Disk class that describes file volumes:
private $commonBlockSizesBytes = [
512,
1024,
2048,
4096,
8192,
16384,</p>
        <p>The main method of the Disk class:
private function run(): void {
$initial = \time();
$tmpDirectoryPath = \realpath(self::$path) . self::$tmpDirectory;
try {
// Create subdirectory
Directory::create($tmpDirectoryPath);
foreach ($this-&gt;commonBlockSizesBytes as $bytes) {</p>
        <p>$this-&gt;counterFileCreation[’Run’][$bytes] = 0;
}
for ($c = $this-&gt;cycles; $c &gt;= 0; $c--) {
// Generate files with different block sizes
foreach ($this-&gt;commonBlockSizesBytes as $bytes) {
$prefix = $initial . ’_’ . $bytes;
$content = $this-&gt;getRandomBytes($bytes);
// Start the timer (measure only disk interaction,
//not string generation etc)
$start = \microtime(true);
$file = \tempnam($tmpDirectoryPath, $prefix);
\file_put_contents($file, $content);
// Stop timer &amp; append time to timer array
// with this block size
$this-&gt;counterFileCreation[’Run’][$bytes] +=</p>
        <p>(\microtime(true) - $start);
}
}
// Clean up</p>
        <p>Directory::removeRecursively($tmpDirectoryPath);
} catch (\Exception $e) {</p>
        <p>Visual::print($e);
}</p>
        <p>}
}</p>
        <p>Getting a given weight file:
private function getRandomBytes($bytes): string {
return random_bytes($bytes);</p>
        <p>When this code is executed, a temporary directory will be created in which the files with the
tested weight size will be written. For each weight, a file is generated and written to disk, and
the time used is added to the array along with the corresponding weight. The files are then
deleted.</p>
        <p>But since we have more than one file, the task of recursive deletion appears. To do this,
we will create an auxiliary class Directory. It implements methods for creating a temporary
directory and deleting files and the directory itself after they are written to disk. Their code is
given below.</p>
        <p>Recursive deletion of generated files and their directories:
public static function removeRecursively($path): void {
if (\file_exists($path)) {
$dir = \opendir($path);
if (\is_resource($dir)) {
while ($file = \readdir($dir)) {
if (($file !== self::$rootPath) &amp;&amp;</p>
        <p>($file !== self::$parentPath)) {
$full = $path . DS . $file;
if (\is_dir($full)) {</p>
        <p>self::removeRecursively($full);
} else {</p>
        <p>\unlink($full);
}</p>
        <p>}
}
\closedir($dir);
}
\rmdir($path);</p>
        <p>Creating a temporary directory:
}
}
}
}
public static function create($path, int $permissions = 0755): bool {
if (!\file_exists($path) &amp;&amp; !mkdir($path, $permissions) &amp;&amp;
!is_dir($path)) {
throw new \RuntimeException(’Could not create directory: ’ . $path);
In the following code, we open the directory and delete the path if it is a file, then exit the
directory and delete the path itself.</p>
        <p>Next is MySQL class. Its main methods are getting the current version of MySQL and
executing an encoded random string.</p>
        <p>Getting the current version of MySQL:
private function getVersion(): void {
$this-&gt;version = \mysqli_get_server_version($this-&gt;connection);
Executing a random encoded string:</p>
        <p>The next class is PHP. It implements the functions of obtaining the current parameters of the
PHP environment. These methods include getting preloaded extensions, getting maximum file
size before uploading, and memory limit.</p>
        <p>Getting the maximum size of the uploaded file:
private function getMaxUploadBytes(): int {
static $max_size = -1;
if ($max_size &lt; 0) {
// Start with post_max_size.
$post_max_size = Size::formatToBytes(\ini_get(’post_max_size’));
if ($post_max_size &gt; 0) {</p>
        <p>$max_size = $post_max_size;
}
// If upload_max_size is less, then reduce. Except if upload_max_size
// is zero, which indicates no limit.
$upload_max = Size::formatToBytes(\ini_get(’upload_max_filesize’));
if ($upload_max &gt; 0 &amp;&amp; $upload_max &lt; $max_size) {</p>
        <p>$max_size = $upload_max;
}
}
return $max_size;
private function getMaxMemoryBytes(): int {
return (int)Size::formatToBytes(\ini_get(’memory_limit’));
To count the input values specified in the ini-file, a separate Size class was created, which
has the following methods.</p>
        <p>Converting bytes to format and vice versa:
public static function bytesToFormat(int $bytes): string {
$power = $bytes &gt; 0 ? \floor(\log($bytes, 1024)) : 0;
return \number_format($bytes / (1024 ** $power), 2, ’.’,</p>
        <p>’,’) . ’ ’ . self::$units[$power];
public static function formatToBytes(string $format): float {
$unit = \preg_replace(self::$unitsRegexPattern, ’’, $format);
$format = \preg_replace(self::$numberRegex, ’’, $format);
return $unit ? \round($format * (1024 **</p>
        <p>\stripos(self::$unitsPattern, $unit[0]))) : \round($format);</p>
        <p>Thus, we obtained the maximum permissible file weight, which is specified in the
configuration file of the executable version of PHP.</p>
        <p>In the root directory there is a file - the starting point for performing all tasks, which contains
the following code:</p>
        <p>The main executable:
&lt;?php
use DI\ContainerBuilder;
use DI\DependencyException;
use DI\NotFoundException;
use Benchmark\Benchmark;
const DS = DIRECTORY_SEPARATOR;
require ’vendor’ . DS . ’autoload.php’;
echo ’&lt;pre&gt;’;
try {</p>
        <p>(new ContainerBuilder())-&gt;build()-&gt;get(Benchmark::class);
} catch (DependencyException | NotFoundException $e) {</p>
        <p>\print_r($e);
}
echo ’&lt;/pre&gt;’ . "\n";</p>
        <p>As a result of this section, a system has been developed, the result of which is the time
intervals of the performed operations, which are presented in a visual form. An example of the
obtained result is given below (figure 5).</p>
        <p>The table contains time measured results for each operation in seconds, lower is better.</p>
      </sec>
      <sec id="sec-4-4">
        <title>4.4. Implementation of visualization of results</title>
        <p>There is a separate method for displaying information that uses a method from another class,
namely line representation, to improve reading comprehension. Its implementation is given
below.</p>
        <p>The method of outputting the resulting information:
public static function print(string $input, string $delimiter = "\n\n"):
void {</p>
        <p>\print_r($input . $delimiter);
}</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Analysis of the obtained results</title>
      <p>Benchmarks are used to achieve a competitive result with any other similar item. In our case,
the diference is the version of PHP for the fastest execution. All results were entered into an
Excel table, where comparative graphs were constructed.</p>
      <p>
        Tests were conducted on the performance of disk (figure 6) and processor operations (figure 7)
and string conversion depending on the language version (figure 8). The results of the analysis
are shown below and represent the operations for each version of PHP, to identify the fastest.
For all tests, a lower value is better. Tests were performed on a local machine with: Ryzen
5600H, 2x8 GB 3200 MHz CL22 PC4-25600 RAM, Samsung M.2 512 GB SSD, Ubuntu 21.04 [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
PHP versions used: 5.6.40, 7.3.31, 8.0.1
      </p>
      <p>Checking the speed of cycle operations (figure 9) and speed test of If/Else statements
(figure 10).</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion</title>
      <p>PHP will continue to be a popular language for the foreseeable future. It is used in web
development, and there are many popular website engines and frameworks written in PHP.
PHP 8 has become faster and more reliable. Compared to previous versions, PHP 8 has many
new and useful features, such as JIT compiler, bug fixes, etc., which will definitely benefit both
users and developers. A benchmark system has been developed for diferent versions of PHP,
which can be extended by other modules if necessary. The result of the system’s operation is
time data reflecting the speed of the selected PHP version. These results might not convince
developers to keep PHP version up-to-date, but may give a focus on improvements they might
seek to achieve using older versions.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Laaziri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Benmoussa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Khoulji</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. L.</given-names>
            <surname>Kerkeb</surname>
          </string-name>
          ,
          <article-title>A Comparative study of PHP frameworks performance</article-title>
          ,
          <source>Procedia Manufacturing</source>
          <volume>32</volume>
          (
          <year>2019</year>
          )
          <fpage>864</fpage>
          -
          <lpage>871</lpage>
          . doi:
          <volume>10</volume>
          .1016/j.promfg.
          <year>2019</year>
          .
          <volume>02</volume>
          .295, 12th International Conference Interdisciplinarity in Engineering,
          <source>INTERENG</source>
          <year>2018</year>
          ,
          <volume>4</volume>
          -5
          <source>October</source>
          <year>2018</year>
          ,
          <string-name>
            <given-names>Tirgu</given-names>
            <surname>Mures</surname>
          </string-name>
          , Romania.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S. I.</given-names>
            <surname>Adam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Andolo</surname>
          </string-name>
          ,
          <article-title>A New PHP Web Application Development Framework Based on MVC Architectural Pattern and Ajax Technology</article-title>
          ,
          <source>in: 2019 1st International Conference on Cybernetics and Intelligent System (ICORIS)</source>
          , volume
          <volume>1</volume>
          ,
          <year>2019</year>
          , pp.
          <fpage>45</fpage>
          -
          <lpage>50</lpage>
          . doi:
          <volume>10</volume>
          .1109/ ICORIS.
          <year>2019</year>
          .
          <volume>8874912</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>I.</given-names>
            <surname>Fedorchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Oliinyk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Stepanenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Zaiko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Shylo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Svyrydenko</surname>
          </string-name>
          ,
          <article-title>Development of the modified methods to train a neural network to solve the task on recognition of road users</article-title>
          ,
          <source>Eastern-European Journal of Enterprise Technologies</source>
          <volume>2</volume>
          (
          <year>2019</year>
          )
          <fpage>46</fpage>
          -
          <lpage>55</lpage>
          . doi:
          <volume>10</volume>
          . 15587/
          <fpage>1729</fpage>
          -
          <lpage>4061</lpage>
          .
          <year>2019</year>
          .
          <volume>164789</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>K. I.</given-names>
            <surname>Bagwan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ghule</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A Modern</given-names>
            <surname>Review On Laravel - PHP Framework</surname>
          </string-name>
          ,
          <source>Iconic Research And Engineering Journals</source>
          <volume>2</volume>
          (
          <year>2019</year>
          )
          <fpage>1</fpage>
          -
          <lpage>3</lpage>
          . URL: https://www.irejournals.com/paper-details/ 1701266.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>M. O'Leary</surname>
          </string-name>
          , PHP, in: Cyber Operations: Building, Defending, and Attacking Modern Computer Networks, Apress, Berkeley, CA,
          <year>2019</year>
          , pp.
          <fpage>983</fpage>
          -
          <lpage>1037</lpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-1-
          <fpage>4842</fpage>
          -4294-0_
          <fpage>20</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A. P.</given-names>
            <surname>Adi</surname>
          </string-name>
          ,
          <string-name>
            <surname>Panduan Cepat Belajar</surname>
            <given-names>HTML</given-names>
          </string-name>
          , PHP,
          <string-name>
            <surname>dan</surname>
            <given-names>MySQL</given-names>
          </string-name>
          , Elex Media Komputindo,
          <year>2020</year>
          . URL: https://openlibrary.telkomuniversity.ac.id/home/catalog/id/161999/ slug/panduan-cepat
          <article-title>-belajar-html-php-dan-mysql</article-title>
          .html.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>C.</given-names>
            <surname>Daniele</surname>
          </string-name>
          ,
          <article-title>What's New in PHP 8 (Features, Improvements, and the JIT Compiler</article-title>
          ),
          <year>2022</year>
          . URL: https://kinsta.com/blog/php-8/.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Zandstra</surname>
          </string-name>
          , PHP 8 Objects, Patterns, and Practice: Mastering OO Enhancements, Design Patterns, and Essential Development Tools, Springer,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S.</given-names>
            <surname>Prettyman</surname>
          </string-name>
          , Learn PHP 8:
          <string-name>
            <surname>Using</surname>
            <given-names>MySQL</given-names>
          </string-name>
          , JavaScript, CSS3, and HTML5, Apress, Berkeley, CA,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>M. Y.</given-names>
            <surname>Tiahunova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. H.</given-names>
            <surname>Kyrychek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. O.</given-names>
            <surname>Bohatyrova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. D.</given-names>
            <surname>Moshynets</surname>
          </string-name>
          ,
          <article-title>System and method of automatic collection of objects in the room</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          <volume>3077</volume>
          (
          <year>2021</year>
          )
          <fpage>174</fpage>
          -
          <lpage>186</lpage>
          . URL: https://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>3077</volume>
          /paper10.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>R.</given-names>
            <surname>Yenduri</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Al-khassaweneh, PHP: Vulnerabilities and Solutions</article-title>
          , in: 2022 2nd
          <string-name>
            <given-names>International</given-names>
            <surname>Mobile</surname>
          </string-name>
          ,
          <source>Intelligent, and Ubiquitous Computing Conference (MIUCC)</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>391</fpage>
          -
          <lpage>396</lpage>
          . doi:
          <volume>10</volume>
          .1109/MIUCC55081.
          <year>2022</year>
          .
          <volume>9781790</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>M.</given-names>
            <surname>Tiahunova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Tronkina</surname>
          </string-name>
          , G. Kirichek,
          <string-name>
            <given-names>S.</given-names>
            <surname>Skrupsky</surname>
          </string-name>
          ,
          <article-title>The Neural Network for Emotions Recognition under Special Conditions</article-title>
          , in: S. Subbotin (Ed.),
          <source>Proceedings of The Fourth International Workshop on Computer Modeling and Intelligent Systems (CMIS-2021)</source>
          , Zaporizhzhia, Ukraine, April
          <volume>27</volume>
          ,
          <year>2021</year>
          , volume
          <volume>2864</volume>
          <source>of CEUR Workshop Proceedings</source>
          , CEURWS.org,
          <year>2021</year>
          , pp.
          <fpage>121</fpage>
          -
          <lpage>134</lpage>
          . URL: https://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2864</volume>
          /paper11.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>G.</given-names>
            <surname>Engebreth</surname>
          </string-name>
          , PHP 8 Revealed:
          <article-title>Use Attributes, the JIT Compiler, Union Types, and More for Web Development</article-title>
          , Apress, Berkeley, CA,
          <year>2021</year>
          . doi:
          <volume>10</volume>
          .1007/978-1-
          <fpage>4842</fpage>
          -6818-6.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>H.</given-names>
            <surname>Su</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Chao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Yuan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Huo</surname>
          </string-name>
          ,
          <article-title>A Sanitizer-centric Analysis to Detect Cross-Site Scripting in PHP Programs</article-title>
          ,
          <source>in: 2022 IEEE 33rd International Symposium on Software Reliability Engineering (ISSRE)</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>355</fpage>
          -
          <lpage>365</lpage>
          . doi:
          <volume>10</volume>
          .1109/ISSRE55969.
          <year>2022</year>
          .
          <volume>00042</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>S.</given-names>
            <surname>Semerikov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Striuk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Striuk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Striuk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Shalatska</surname>
          </string-name>
          ,
          <source>Sustainability in Software Engineering Education: a case of general professional competencies 166</source>
          (
          <year>2020</year>
          )
          <article-title>10036</article-title>
          . doi:
          <volume>10</volume>
          .1051/e3sconf/202016610036.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>R.</given-names>
            <surname>Dharsan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Krishanthini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Traveena</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Anubama</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. I. D.</given-names>
            <surname>Silva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Thisuru</surname>
          </string-name>
          ,
          <string-name>
            <surname>Analyzing PHP</surname>
          </string-name>
          Project - Medicare,
          <source>International Journal of Engineering and Management Research</source>
          <volume>12</volume>
          (
          <year>2022</year>
          )
          <fpage>432</fpage>
          -
          <lpage>440</lpage>
          . doi:
          <volume>10</volume>
          .31033/ijemr.12.5.55.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>