{"id":34,"date":"2019-01-22T19:35:22","date_gmt":"2019-01-22T19:35:22","guid":{"rendered":"https:\/\/beta.smarthost.eu\/blog\/?p=34"},"modified":"2019-02-22T14:40:41","modified_gmt":"2019-02-22T14:40:41","slug":"34","status":"publish","type":"post","link":"https:\/\/www.smarthost.au\/blog\/34","title":{"rendered":"We implement PHP 7.3 and compare it with other versions"},"content":{"rendered":"<p>From today our servers works the latest version of PHP 7.3. It brings many changes, new functions, and improvements &#8211; one of the latter is the increase the speed of script processing compared to previous versions. All news related to PHP 7.3 can be found in &#8220;What&#8217;s new in PHP 7.3?&#8221; and meanwhile, we are going to tests \ud83d\ude42<\/p>\n<p>In order to compare the latest versions of PHP we made account in package premium-ssd-www (recommended among others for online stores) on normal server where client&#8217;s accounts are created &#8211; Actually it is server 21 \u2013 That is quite important information because the majority of tests we have encountered till now was carried out in \u201elaboratory\u201d conditions in other words on website made special for testing PHP. We, in turn, analyzed the operation of scripts from the point of view of an ordinary user to make the results are more reliable. We tested scripts ten times, then we took out the average of the results<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium aligncenter\" src=\"https:\/\/www.smarthost.pl\/blog\/wp-content\/uploads\/2019\/01\/PHP-7.3-benchmark-1.jpg\" width=\"928\" height=\"558\"><\/p>\n<table border=\"\">\n<tbody>\n<tr>\n<td><\/td>\n<td style=\"text-align: center;\">PHP 5.6<\/td>\n<td style=\"text-align: center;\">PHP 7.0<\/td>\n<td style=\"text-align: center;\">PHP 7.1<\/td>\n<td style=\"text-align: center;\">PHP 7.2<\/td>\n<td style=\"text-align: center;\">PHP 7.3<\/td>\n<\/tr>\n<tr>\n<td>bench.php<\/td>\n<td style=\"text-align: center;\">2.680 s<\/td>\n<td style=\"text-align: center;\">1.038 s<\/td>\n<td style=\"text-align: center;\">0.749 s<\/td>\n<td style=\"text-align: center;\">0.499 s<\/td>\n<td style=\"text-align: center;\">0.385 s<\/td>\n<\/tr>\n<tr>\n<td>increase of speed compared with previous version<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td style=\"text-align: center;\">158%<\/td>\n<td style=\"text-align: center;\">39%<\/td>\n<td style=\"text-align: center;\">50%<\/td>\n<td style=\"text-align: center;\">29%<\/td>\n<\/tr>\n<tr>\n<td>increase of speed compared with PHP 5.6<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td style=\"text-align: center;\">158%<\/td>\n<td style=\"text-align: center;\">258%<\/td>\n<td style=\"text-align: center;\">437%<\/td>\n<td style=\"text-align: center;\">596%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td style=\"text-align: center;\">PHP 5.6<\/td>\n<td style=\"text-align: center;\">PHP 7.0<\/td>\n<td style=\"text-align: center;\">PHP 7.1<\/td>\n<td style=\"text-align: center;\">PHP 7.2<\/td>\n<td style=\"text-align: center;\">PHP 7.3<\/td>\n<\/tr>\n<tr>\n<td>micro_bench.php<\/td>\n<td style=\"text-align: center;\">12.632 s<\/td>\n<td style=\"text-align: center;\">4.241 s<\/td>\n<td style=\"text-align: center;\">3.569 s<\/td>\n<td style=\"text-align: center;\">2.845 s<\/td>\n<td style=\"text-align: center;\">2.454 s<\/td>\n<\/tr>\n<tr>\n<td>increase of speed compared with previous version<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td style=\"text-align: center;\">198%<\/td>\n<td style=\"text-align: center;\">18%<\/td>\n<td style=\"text-align: center;\">25%<\/td>\n<td style=\"text-align: center;\">15%<\/td>\n<\/tr>\n<tr>\n<td>increase of speed compared with PHP 5.6<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td style=\"text-align: center;\">198%<\/td>\n<td style=\"text-align: center;\">253%<\/td>\n<td style=\"text-align: center;\">344%<\/td>\n<td style=\"text-align: center;\">415%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The shorter time is better. \ud83d\ude42<\/p>\n<p>A few words about used scripts:<\/p>\n<p>bench.php<\/p>\n<p>This script mainly performs tasks in loop, except simple functions (which in the loop performs incrementing of the variable value, calculates the length of the string or call an empty function) performs also among others the following tasks:<\/p>\n<p>-calculates the Mandelbrot\u2019s collection<\/p>\n<p>-Ackermann\u2019s function<\/p>\n<p>-calculates the Fibonacci collection<\/p>\n<p>-sorts the pile<\/p>\n<p>-creates a multidimensional array<\/p>\n<p><span lang=\"pl-PL\">Source: <\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Lato, sans-serif;\"><span style=\"font-size: medium;\"><span lang=\"pl-PL\"><u><a href=\"https:\/\/github.com\/php\/php-src\/blob\/master\/Zend\/bench.php\">https:\/\/github.com\/php\/php-src\/blob\/master\/Zend\/bench.php<\/a><\/u><\/span><\/span><\/span><\/span><\/p>\n<p>micro_bench.php<\/p>\n<p>This script also relies on loops and performs among others the following tasks:<\/p>\n<p>-calls a function in the loop<\/p>\n<p>-reads the value of the object&#8217;s property<\/p>\n<p>-writes the value in object\u2019s property<\/p>\n<p>-checks whether the value is assigned to the object&#8217;s property<\/p>\n<p>-checks whether the value of the object\u2019s property is not empty<\/p>\n<p>-invokes the method of object<\/p>\n<p>-reads the value of the static property of the object<\/p>\n<p>-writes the value in the static property of the object<\/p>\n<p>-checks whether a value is assigned to the static property of the object<\/p>\n<p>-checks whether the value of the static property of the object is empty<\/p>\n<p>-invokes the static method of object<\/p>\n<p><span lang=\"pl-PL\">Source: <\/span><span style=\"color: #ff0000;\"><span style=\"font-family: Lato, sans-serif;\"><span style=\"font-size: medium;\"><u><a href=\"https:\/\/github.com\/php\/php-src\/blob\/master\/Zend\/micro_bench.php\">https:\/\/github.com\/php\/php-src\/blob\/master\/Zend\/micro_bench.php<\/a><\/u><\/span><\/span><\/span><\/p>\n<p>As you can see the scripts from version to version perform faster.<\/p>\n<p>The above tests have been carried out according to the benchmark <span style=\"color: #ff0000;\"><span style=\"font-family: Lato, sans-serif;\"><span style=\"font-size: medium;\"><u><a href=\"https:\/\/www.phpclasses.org\/blog\/post\/493-php-performance-evolution.html\">PHP Performance Comparison 2018 and 2017<\/a><\/u><\/span><\/span><\/span> created by Christian Vigh.<\/p>\n<p>We encourage you to perform PHP 7.3 performance tests yourself on SSD hosting<\/p>\n<p>&#8211; all you need to do is choose any of the hosting packages, because each of the hosting accounts is in the PHP 7.3 standard.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From today our servers works the latest version of PHP 7.3. It brings many changes, new functions, and improvements &#8211; one of the latter is the increase the speed of script processing compared to previous<a class=\"read-more\" href=\"https:\/\/www.smarthost.au\/blog\/34\">Continue reading<\/a><\/p>\n","protected":false},"author":16,"featured_media":57,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[6,7,5],"class_list":["post-34","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-website-speed","tag-php-7-2-and-php-7-3-benchmark","tag-php-7-3-benchmark","tag-php-7-3-cpanel"],"_links":{"self":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":4,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions\/58"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/media\/57"}],"wp:attachment":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}