{"id":9835,"date":"2021-02-25T18:04:27","date_gmt":"2021-02-25T12:34:27","guid":{"rendered":"https:\/\/www.konstantinfo.com\/blog\/?p=9835"},"modified":"2021-11-17T13:03:39","modified_gmt":"2021-11-17T07:33:39","slug":"php-8-features","status":"publish","type":"post","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/","title":{"rendered":"PHP 8 Features, Challenges, Trends in 2021"},"content":{"rendered":"<p>PHP 8 was officially released on November 20, 2021. PHP 8.0 is the latest version of PHP (updated February 2021). It brings in advanced security, more than PHP 7.4 and older versions. It comes with major issue fixes and performance improvements for WordPress sites.<\/p>\n<p>We&#8217;re about to discuss major features, shortcomings and trends that PHP 8 comes up with within 2021.<\/p>\n<h2>PHP 8 Features<\/h2>\n<ul>\n<li><strong>Just-In-Time compilation<\/strong> &#8211; PHP 8 introduces\u00a02 JIT compilation engines. Tracing JIT shows about\u00a0three times better performance on synthetic benchmarks and 1.5\u20132 times improvement on some specificed long-running applications. Typical application performance is on par with PHP 7.4.<\/li>\n<\/ul>\n<ul>\n<li><strong>Type-System and Error Handling Improvements<\/strong> \u2013 PHP 8.0 has strict type checks for arithmetic\/bitwise operators RFC. This includes: (1) Abstract trait method (2) Correct signatures of magic methods (3) Reclassified engine warnings (4) Fatal error for an incompatible method (5) @ is not useful in case of fatal errors (6) Inheritance with private methods (7) Mixed type (8) Static return type (9) Types for internal functions Email thread &#8211; Opaque objects instead of resources for Curl, OpenSSL, Gd, XMLWriter, XML extensions and Sockets.<\/li>\n<\/ul>\n<h2>Improvements: In PHP 8<\/h2>\n<p>PHP 8.0 is faster than PHP 7.3\/7.4. At most 65% of websites including Facebook, Wikipedia, WordPress support PHP.\u00a0\u00a0 It features improvements in \u2013<\/p>\n<p>(1) named arguments,<\/p>\n<p>(2) union types,<\/p>\n<p>(3) constructor property promotion,<\/p>\n<p>(4) constructor,<\/p>\n<p>(5) match expression,<\/p>\n<p>(6) JIT,<\/p>\n<p>(7) null-safe operator,<\/p>\n<p>(8) error handling,<\/p>\n<p>(9) improvements in the type system,<\/p>\n<p>(10) better performance,<\/p>\n<p>(11) consistency,<\/p>\n<p>(12) type safety and better syntax.<\/p>\n<p>(13) A trailing comma in parameter lists RFC and closure use lists RFC,<\/p>\n<p>(14) Non-capturing catches RFC,<\/p>\n<p>(15) Variable Syntax Tweaks RFC,<\/p>\n<p>(16) Treat namespaced names as single token RFC,<\/p>\n<p>(17) Throw is now an expression RFC,<\/p>\n<p>(18) Allow ::class on objects RFC,<\/p>\n<p>(19) New Classes, Interfaces, and Functions \u2013 (i) Weak Map class, (ii) Stringable interface, (iii) <span style=\"color: #0000ff;\">str_contains(),<\/span> <span style=\"color: #0000ff;\">str_starts_with()<\/span>, <span style=\"color: #0000ff;\">str_ends_with()<\/span>, (iv) <span style=\"color: #0000ff;\">fdiv()<\/span>,\u00a0 (v) \u00a0\u00a0<span style=\"color: #0000ff;\">get_debug_type()<\/span>,\u00a0 (vi) <span style=\"color: #0000ff;\">get_resource_id()<\/span>, (vii) <span style=\"color: #0000ff;\">token_get_all()<\/span> object implementation, (viii) \u00a0New DOM Traversal and Manipulation APIs<\/p>\n<h2>Prominent Applications: Companies Using PHP<\/h2>\n<p>PHP is being used by many famous companies like (1) Facebook, (2) Slack, (3) Wikipedia, (4) Hootsuite, (5) 9GAG, (6) Vimeo, (7) Tesla and (8) WordPress etc.<\/p>\n<h2>Technology Stack: Used by Major Companies<\/h2>\n<p><strong>Facebook Technology Stack<\/strong><\/p>\n<ul>\n<li>PHP, ReactJS, Cassandra, Graphql, Hive<\/li>\n<li>DevOps: Jenkins, Datadog, Chef<\/li>\n<\/ul>\n<p><strong>Hootsuite Technology Stack<\/strong><\/p>\n<ul>\n<li>PHP, JQuery, Bootstrap, MySQL, AWS, MongoDB, Kafka, Scala<\/li>\n<li>DevOps: Jenkins, Docker, Github<\/li>\n<\/ul>\n<p><strong>9Gag Technology Stack<\/strong><\/p>\n<ul>\n<li>PHP, Laravel, VueJS, JavaScript, NgINX, Scala, AWS S3, Python, Scala, Java<\/li>\n<li>DevOps: GitHub, Datadog, Docker<\/li>\n<\/ul>\n<h2>Backwards Compatibility: Feature Support<\/h2>\n<p>If an attribute is used in its line, PHP 8.0 will not cause an error. PHP ignores those attributes. Previous versions of PHP (7.0, 7.1, 7.2, 7.3 and 7.4) feature support for (1) typed properties, (2) support for arrow functions, (3) covariant returns, (4) contravarian parameters, (5) coalescence assignment operator support, (6) support for weak references, (7) preloading, (8) propagation operator in array expression and (9) deprecations.<\/p>\n<h2>Trends: PHP Trends in 2021<\/h2>\n<p>PHP is and will remain one of the basic building blocks of web development. Coming together with third-party frameworks, PHP accounts for robust and productive applications.<\/p>\n<p>Best PHP frameworks in 2021 are (1) Laravel, (2) Phalcon, (3) Symfony, (4) CodeIgniter, (5) CakePHP, (6) Yii, (7) Slim Framework and (8) Lumen.<\/p>\n<p>PHP works wonders with CMS like WordPress and Drupal.<\/p>\n<p>Developers choose <a href=\"https:\/\/www.konstantinfo.com\/blog\/php-frameworks\/\" target=\"_blank\">PHP frameworks<\/a> based on performance, security, advanced features, and the level of community support. If all this in place, it becomes easier to check with upcoming PHP features and build a web application likewise.<\/p>\n<h2>Differences PHP 7 vs. PHP 8<\/h2>\n<div class=\"table-responsive\">\n<table class=\"table-bordered\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<thead>\n<tr>\n<th><strong>Differences<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<th><strong>PHP 7<\/strong><\/th>\n<th><strong>PHP 8<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"200\">Named Arguments<\/td>\n<td width=\"200\">Arguments, parameters are order-dependent, self-documented.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9861\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/named-arguments.png\" alt=\"named arguments\" width=\"169\" \/><\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9860\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/named-arguments-1.png\" alt=\"named arguments\" width=\"198\" \/><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Attributes<\/td>\n<td width=\"200\">We can now use structured metadata with PHP\u2019s native syntax instead of PHPDoc annotations.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9853\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/attributes.png\" alt=\"attributes\" width=\"169\" \/><\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9852\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/attributes-1.png\" alt=\"attributes\" width=\"197\" \/><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Constructor Property<\/td>\n<td width=\"200\">Less repetitive code sections to define and initialize properties.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9857\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/constructor-property.png\" alt=\"constructor property\" width=\"153\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/constructor-property.png 153w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/constructor-property-149x300.png 149w\" sizes=\"(max-width: 153px) 100vw, 153px\" \/><\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9856\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/constructor-property-1.png\" alt=\"constructor property\" width=\"181\" \/><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Union Types<\/td>\n<td width=\"200\">Use of Native union type declarations instead of PHPDoc annotations for a combination of types validated at runtime.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9872\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/union-types.png\" alt=\"union types\" width=\"173\" \/><\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9871\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/union-types-1.png\" alt=\"union types\" width=\"197\" \/><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Match Expression<\/td>\n<td width=\"200\">The result of a match expression is stored in a variable. \u2018Match\u2019 (1) Performs strict comparisons,<\/p>\n<p>(2) Supports single-line expressions,<\/p>\n<p>(3) Does not need a break.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9859\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/match-expression.png\" alt=\"match expression\" width=\"172\" \/><\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9858\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/match-expression-1.png\" alt=\"match expression\" width=\"190\" \/><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Nullsafe operator<\/td>\n<td width=\"200\">Instead of null check conditions, you can now use a chain of calls with the new null safe operator. When the evaluation of one element in the chain fails, the execution of the entire chain aborts and the entire chain evaluates to null.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9862\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/Nullsafe-operator.png\" alt=\"nullsafe operator\" width=\"170\" \/> }<\/p>\n<p>}<\/td>\n<td width=\"200\">$country\u00a0=\u00a0$session?-&gt;user?-&gt;getAddress()?-&gt;country;<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">String to number comparisons<\/td>\n<td width=\"200\">PHP 8 uses a number comparison, while comparing to a numeric string.<\/td>\n<td width=\"200\">0 ==&#8217;foobar&#8217; \/\/ true<\/td>\n<td width=\"200\">\u00a00\u00a0==&#8217;foobar&#8217; \/\/\u00a0false<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Consistent type errors for internal functions<\/td>\n<td width=\"200\">The internal functions throw an Error exception in case the validation of the parameters fails.<\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9855\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/consistent-type-errors.png\" alt=\"consistent type errors\" width=\"171\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/consistent-type-errors.png 171w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/consistent-type-errors-150x150.png 150w\" sizes=\"(max-width: 171px) 100vw, 171px\" \/><\/td>\n<td width=\"200\">\u00a0<img decoding=\"async\" class=\"aligncenter size-full wp-image-9854\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/consistent-type-errors-1.png\" alt=\"consistent type errors\" width=\"191\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>As we go ahead, exploring the migration from PHP 7.4.x to PHP 8.0.x, the enhancements include:<\/p>\n<ul>\n<li>The WeakMap class<\/li>\n<li>ValueError class<\/li>\n<li>Variadic arguments now replace function parameters (with compatible types)<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9845\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature.png\" alt=\"other feature\" width=\"950\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature.png 950w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-300x59.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-768x152.png 768w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><\/p>\n<ul>\n<li>Static (Late state binding) is now used as a return type<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9841\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-1.png\" alt=\"other feature\" width=\"909\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-1.png 909w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-1-300x57.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-1-768x145.png 768w\" sizes=\"(max-width: 909px) 100vw, 909px\" \/><\/p>\n<ul>\n<li>Fetch the class name of an object by using $object::class. It gives the same result as get_class($object).<\/li>\n<li>new (expression)(&#8230;$args) and $obj instance of (expression) replace new and instance of<\/li>\n<li>minor consistency fixes to variable syntax e.g. We cannot write Foo::BAR::$baz<\/li>\n<li>A class defined with __toString() method brings in a Stringable interface automatically.<\/li>\n<li>Traits define abstract private methods.<\/li>\n<li>The throw becomes an expression in PHP 8.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9842\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-2.png\" alt=\"other feature\" width=\"889\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-2.png 889w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-2-300x28.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-2-768x72.png 768w\" sizes=\"(max-width: 889px) 100vw, 889px\" \/><\/p>\n<ul>\n<li>The parameter list allows commas.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9843\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-3.png\" alt=\"other feature\" width=\"894\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-3.png 894w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-3-300x51.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-3-768x131.png 768w\" sizes=\"(max-width: 894px) 100vw, 894px\" \/><\/p>\n<ul>\n<li>PHP 8 enables catching an exception without storing it in a variable.<\/li>\n<li>PHP 8 supports mixed types<\/li>\n<li>Private methods declared within parent class do not enforce inheritance of child class.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9844\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-4.png\" alt=\"other feature\" width=\"837\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-4.png 837w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-4-300x141.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/other-feature-4-768x360.png 768w\" sizes=\"(max-width: 837px) 100vw, 837px\" \/><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">get_resource_id()<\/span><\/em>\u00a0 returns the same value as (int) $resource<\/li>\n<\/ul>\n<ul>\n<li><strong>Date and Time<\/strong><\/li>\n<\/ul>\n<p><em><span style=\"color: #3366ff;\">DateTime::createFromInterface()<\/span><\/em>\u00a0and\u00a0<em><span style=\"color: #3366ff;\">DateTimeImmutable::createFromInterface()<\/span><\/em> for DateTime format specifier\u00a0p\u00a0&#8211; same as\u00a0P\u00a0but returns\u00a0Z\u00a0rather than\u00a0+00:00\u00a0for UTC.<\/p>\n<ul>\n<li><strong>DOM<\/strong><\/li>\n<\/ul>\n<p><em><span style=\"color: #3366ff;\">DOMParentNode<\/span><\/em> and <em><span style=\"color: #3366ff;\">DOMChildNode<\/span><\/em> now come with a new traversal and manipulation API.<\/p>\n<ul>\n<li><strong>Filter<\/strong><\/li>\n<\/ul>\n<p><em><span style=\"color: #3366ff;\">FILTER_VALIDATE_BOOLEAN<\/span><\/em> is now known as <em><span style=\"color: #3366ff;\">FILTER_VALIDATE_BOOL<\/span><\/em>.<\/p>\n<ul>\n<li><strong>Enchant<\/strong><\/li>\n<\/ul>\n<p><em><span style=\"color: #3366ff;\">enchant_dict_add()<\/span><\/em>,\u00a0<em><span style=\"color: #3366ff;\">enchant_dict_is_added()<\/span><\/em>, and\u00a0<span style=\"color: #3366ff;\">LIBENCHANT_VERSION<\/span><\/p>\n<ul>\n<li><strong>FPM<\/strong><\/li>\n<\/ul>\n<p>It comes with <em><span style=\"color: #3366ff;\">pm.status_listen<\/span><\/em>\u00a0to get status from different endpoints (port or UDS file).<\/p>\n<ul>\n<li><strong>Hash<\/strong><\/li>\n<\/ul>\n<p><span style=\"color: #3366ff;\">HashContext<\/span> objects are now serializable.<\/p>\n<ul>\n<li><strong>Internationalization Functions<\/strong><\/li>\n<\/ul>\n<p>Some constants are added like<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9838\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/internationalization-functions.png\" alt=\"internationalization-functions\" width=\"909\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/internationalization-functions.png 909w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/internationalization-functions-300x28.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/internationalization-functions-768x71.png 768w\" sizes=\"(max-width: 909px) 100vw, 909px\" \/><\/p>\n<ul>\n<li><strong>LDAP<\/strong><\/li>\n<\/ul>\n<p>It now has <em><span style=\"color: #3366ff;\">ldap_count_references()<\/span><\/em>.<\/p>\n<ul>\n<li><strong>OPcache<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9839\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/opcache.png\" alt=\"opcache\" width=\"1032\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/opcache.png 1032w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/opcache-300x22.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/opcache-768x57.png 768w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/opcache-1024x75.png 1024w\" sizes=\"(max-width: 1032px) 100vw, 1032px\" \/><\/p>\n<ul>\n<li><strong>OpenSSL<\/strong><\/li>\n<\/ul>\n<p>It comes with Cryptographic Message Syntax (CMS) with addition of new encoding constants:\u00a0<em><span style=\"color: #3366ff;\">OPENSSL_ENCODING_DER,\u00a0OPENSSL_ENCODING_SMIME\u00a0and\u00a0OPENSSL_ENCODING_PEM:<\/span><\/em><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">openssl_cms_encrypt()<\/span> <\/em>\u2013 to encrypt messages in the file.<\/li>\n<li><em><span style=\"color: #3366ff;\">openssl_cms_decrypt()<\/span><\/em> \u2013 to decrypt the S\/MIME message.<\/li>\n<li><em><span style=\"color: #3366ff;\">openssl_cms_read()<\/span><\/em>\u00a0\u2013 to export the CMS file to an array of PEM certificates.<\/li>\n<li><em><span style=\"color: #3366ff;\">openssl_cms_sign()<\/span><\/em> \u2013 to sign the MIME message in the file with cert key and output to supplied file.<\/li>\n<li><em><span style=\"color: #3366ff;\">openssl_cms_verify()<\/span><\/em> \u2013 to verify that data block is intact.<\/li>\n<\/ul>\n<ul>\n<li><strong>Regular Expressions (Perl-Compatible)<\/strong><\/li>\n<\/ul>\n<p>It comes with <em><span style=\"color: #3366ff;\">preg_last_error_msg()<\/span><\/em> and complements <em><span style=\"color: #3366ff;\">preg_last_error() <\/span><\/em>which retruns an integer enum value.<\/p>\n<ul>\n<li><strong>Reflection<\/strong><\/li>\n<\/ul>\n<p>A few methods return default values of parameters\/internal functions<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9848\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection.png\" alt=\"reflection\" width=\"408\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection.png 408w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-300x83.png 300w\" sizes=\"(max-width: 408px) 100vw, 408px\" \/><\/p>\n<ul>\n<li><strong>SQLite3<\/strong><\/li>\n<\/ul>\n<p><em><span style=\"color: #3366ff;\">SQLite3::setAuthorizer()<\/span><\/em>\u00a0and respective class constants are added to userland callback.<\/p>\n<ul>\n<li><strong>Standard Library<\/strong><\/li>\n<\/ul>\n<p>Following methods come along with some changes:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9850\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library.png\" alt=\"standard library\" width=\"1024\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library.png 1024w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-300x153.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-768x392.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><img decoding=\"async\" class=\"aligncenter size-full wp-image-9849\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-1.png\" alt=\"standard library\" width=\"1023\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-1.png 1023w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-1-300x212.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-1-768x543.png 768w\" sizes=\"(max-width: 1023px) 100vw, 1023px\" \/>&lt;\/&gt;<\/p>\n<ul>\n<li><strong>Tokenizer<\/strong><\/li>\n<\/ul>\n<p>PHP 8 comes with a tokenizer appended to PHPToken. It provides a uniform and ergonomic representation being memory efficient and quick.<\/p>\n<ul>\n<li><strong>Zip<\/strong><\/li>\n<\/ul>\n<p>It comes with multiple updates (version 1.19.1)<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9851\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip.png\" alt=\"zip\" width=\"1019\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip.png 1019w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip-300x155.png 300w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip-768x398.png 768w\" sizes=\"(max-width: 1019px) 100vw, 1019px\" \/><\/p>\n<h2>Backward Incompatible Changes<\/h2>\n<ul>\n<li>Following methods come with slight changes \u2013 MBString, LDAP, IMAP, Internationalization Functions, Iconv, GMP, GD, Filter, Exif, Enchant, DOM, Date and Time, CURL, COM and .Net (Windows), and Resource to Object Migration.<\/li>\n<li>Several notices are convertible into warnings<\/li>\n<li>number of warnings are convertible into Error exceptions<\/li>\n<li>No need to define case-insensitive constants now.<\/li>\n<li>The match is now a reserved keyword<\/li>\n<li>track_errors ini directives are not in use.<\/li>\n<\/ul>\n<p><strong>OCI8<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">OCILob<\/span><\/em> is the new name for OCI-Lob\u00a0class. <em><span style=\"color: #3366ff;\">OCICollection<\/span><\/em> is the new name for the\u00a0OCI-Collection\u00a0class.<\/li>\n<li>PHP 8 deprecates alias functions.<\/li>\n<\/ul>\n<p><strong>ODBC<\/strong><\/p>\n<ul>\n<li>The unused flags parameter of <em><span style=\"color: #3366ff;\">odbc_exec()<\/span><\/em> is not in use.<\/li>\n<li><em><span style=\"color: #3366ff;\">odbc_connect()<\/span><\/em> does not reuse connections.<\/li>\n<\/ul>\n<p><strong>OpenSSL<\/strong><\/p>\n<ul>\n<li><em><a href=\"https:\/\/www.php.net\/manual\/en\/function.openssl-seal\">openssl_seal()<\/a><\/em>\u00a0and\u00a0<em><a href=\"https:\/\/www.php.net\/manual\/en\/function.openssl-open\">openssl_open()<\/a>\u00a0<\/em>now require method.<\/li>\n<\/ul>\n<p><strong>Regular Expressions (Perl-Compatible)<\/strong><\/p>\n<ul>\n<li>Ignore X-modifier; invalid escape sequences are not interpretable as literals.<\/li>\n<\/ul>\n<p><strong>PHP Data Objects\u00a0<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">&#8220;exceptions&#8221; replaces &#8220;Error handling&#8221;<\/span> mode. It comes with changes to some PDO methods.<\/li>\n<\/ul>\n<p><strong>PDO ODBC<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">\u2018pdo_odbc.db2_instance_name\u2019,<\/span><\/em> the PHP.ini directive no longer exists.<\/li>\n<\/ul>\n<p><strong>PDO MySQL<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">PDO::inTransaction()<\/span> reports an actual transaction state of the connection rather than an approximation maintained by PDO.<\/li>\n<\/ul>\n<p><strong>PostgreSQL<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">pg_connect()<\/span>\u00a0syntax, <span style=\"color: #3366ff;\">pg_lo_import()<\/span>\u00a0and\u00a0<span style=\"color: #3366ff;\">pg_lo_export()<\/span>\u00a0signature \u2013 is not supported.<\/li>\n<li><span style=\"color: #3366ff;\">pg_fetch_all()<\/span>\u00a0will now return an empty array instead of false for zero rows.<\/li>\n<\/ul>\n<p><strong>Phar\u00a0<\/strong><\/p>\n<ul>\n<li>Phar metadata will not <em>auto-unserialize<\/em> owing to security vulnerabilities due to object instantiation, auto-loading etc.<\/li>\n<\/ul>\n<p><strong>Reflection\u00a0<\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9866\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-1.png\" alt=\"reflection\" width=\"644\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-1.png 644w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-1-300x53.png 300w\" sizes=\"(max-width: 644px) 100vw, 644px\" \/><\/p>\n<ul>\n<li>PHP 7 and PHP 8 codes make use of these signatures:<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9867\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-2.png\" alt=\"reflection\" width=\"365\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-2.png 365w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/reflection-2-300x73.png 300w\" sizes=\"(max-width: 365px) 100vw, 365px\" \/><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">ReflectionType::__toString()<\/span><\/em> now returns a complete debug representation of the type. The results will contain a nullability indicator for nullable types. (The return value depends on PHP version)<\/li>\n<li>Reflection objects can cast to string instead of Reflection export() which does not exist.<\/li>\n<li><em><span style=\"color: #3366ff;\">ReflectionMethod::isConstructor()<\/span><\/em>\u00a0and\u00a0<em><span style=\"color: #3366ff;\">ReflectionMethod::isDestructor()<\/span><\/em>\u00a0returns true for construct() and destruct() methods of interfaces.<\/li>\n<li><em><span style=\"color: #3366ff;\">ReflectionNamedType<\/span><\/em> replaces <em><span style=\"color: #3366ff;\">ReflectionType::isBuiltin()<\/span><\/em>\u00a0method.<\/li>\n<\/ul>\n<p><strong>Sockets\u00a0<\/strong><\/p>\n<ul>\n<li>PHP 8 does not support <em><span style=\"color: #3366ff;\">AI_IDN_ALLOW_UNASSIGNED\u00a0and\u00a0AI_IDN_USE_STD3_ASCII_RULES<\/span><\/em>\u00a0flags\u00a0for\u00a0<em><span style=\"color: #3366ff;\">socket_addrinfo_lookup()<\/span><\/em> any more.<\/li>\n<\/ul>\n<p><strong>Standard PHP Library (SPL)\u00a0<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">SplFileObject::fgetss()<\/span>\u00a0\u2013 does not exist.<\/li>\n<li><span style=\"color: #3366ff;\">SplFileObject::seek()<\/span> starts the line.<\/li>\n<li>Compatible method signature use <span style=\"color: #3366ff;\">SplHeap::compare()<\/span> in inheriting classes.<\/li>\n<li><span style=\"color: #3366ff;\">SplDoublyLinkedList::push()<\/span>,\u00a0<span style=\"color: #3366ff;\">SplDoublyLinkedList::unshift()\u00a0<\/span>and\u00a0<span style=\"color: #3366ff;\">SplQueue::enqueue()<\/span> returns void instead of true.<\/li>\n<li><span style=\"color: #3366ff;\">spl_autoload_register()<\/span>\u00a0will now always throw a\u00a0TypeError<\/li>\n<li><span style=\"color: #3366ff;\">SplFixedArray::rewind()<\/span>,\u00a0<span style=\"color: #3366ff;\">SplFixedArray::current()<\/span>,\u00a0<span style=\"color: #3366ff;\">SplFixedArray::key()<\/span>,\u00a0<span style=\"color: #3366ff;\">SplFixedArray::next()<\/span>, and\u00a0<span style=\"color: #3366ff;\">SplFixedArray::valid()<\/span>\u00a0do not exist.<\/li>\n<li><span style=\"color: #3366ff;\">SplFixedArray<\/span> works like an IteratorAggregate.<\/li>\n<li><span style=\"color: #3366ff;\">SplFixedArray<\/span> is now used in nested loops<\/li>\n<\/ul>\n<p><strong>Standard Library<\/strong><\/p>\n<ul>\n<li>Functions that no longer exist: <em><span style=\"color: #3366ff;\">hebrevc(), convert_cyr_string(), money_format(), ezmlm_hash(), restore_include_path(), get_magic_quotes_gpc(), get_magic_quotes_runtime(), fgetss()<\/span><\/em><\/li>\n<li><em>assert()<\/em>\u00a0are now used as arguments instead of evaluating string arguments.<\/li>\n<li>Specify result array to use <em><span style=\"color: #3366ff;\">parse_str()<\/span><\/em><\/li>\n<li><span style=\"color: #3366ff;\">strip_tags<\/span> do not exist in PHP 8.<\/li>\n<li>The needle argument of <span style=\"color: #3366ff;\">strpos(),\u00a0strrpos(),\u00a0stripos(),\u00a0strripos(),\u00a0strstr(),\u00a0strchr(),\u00a0strrchr(), and\u00a0stristr()<\/span> are now interpreted as String needles.<\/li>\n<li>The length arguments for <span style=\"color: #3366ff;\">substr(),\u00a0substr_compare(),substr_count()<\/span> and\u00a0<span style=\"color: #3366ff;\">iconv_substr()<\/span> can now be null.<\/li>\n<li>The\u00a0length\u00a0argument for\u00a0<span style=\"color: #3366ff;\">array_splice()<\/span>\u00a0accepts Null.<\/li>\n<li>The\u00a0args\u00a0argument of\u00a0<span style=\"color: #3366ff;\">vsprintf(),\u00a0vfprintf()<\/span>, and\u00a0<span style=\"color: #3366ff;\">vprintf()<\/span>\u00a0must now be an array.<\/li>\n<li>The\u00a0&#8216;salt&#8217;\u00a0option of\u00a0<span style=\"color: #3366ff;\">password_hash()<\/span>\u00a0is not supported now.<\/li>\n<li>The quotemeta()\u00a0function now returns an empty string.<\/li>\n<li><span style=\"color: #3366ff;\">FILTER_SANITIZE_MAGIC_QUOTES<\/span> no longer exist.<\/li>\n<li>implode()\u00a0with parameters in a reverse order\u00a0($pieces, $glue)is not supported.<\/li>\n<li>The deprecated DES fallback in\u00a0<em><span style=\"color: #3366ff;\">crypt()<\/span><\/em>\u00a0no longer exists.<\/li>\n<li>The HTTP stream wrapper that is used by functions like <span style=\"color: #3366ff;\">file_get_contents()<\/span> now features HTTP\/1.1 rather than HTTP\/1.0 by default.<\/li>\n<li><span style=\"color: #3366ff;\">quotemeta()<\/span>\u00a0function returns an empty string now.<\/li>\n<li><span style=\"color: #3366ff;\">parse_url()<\/span> distinguishes empty queries and fragments:<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9868\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-2.png\" alt=\"standard php library\" width=\"379\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-2.png 379w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-2-300x96.png 300w\" sizes=\"(max-width: 379px) 100vw, 379px\" \/><\/p>\n<p>Previously all cases resulted in query and fragment being\u00a0null.<\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">var_dump()<\/span>\u00a0and\u00a0<span style=\"color: #3366ff;\">debug_zval_dump()<\/span>\u00a0use\u00a0<em><span style=\"color: #3366ff;\">serialize_precision<\/span><\/em>\u00a0rather than\u00a0precision and will now print floating-point numbers.<\/li>\n<li>The start-up features\u00a0&#8220;C&#8221; as the default locale. The environment does not inherit Locales by default.<\/li>\n<li>The HTTP stream wrapper used by <em><span style=\"color: #3366ff;\">file_get_contents()<\/span><\/em> function\u00a0now features HTTP\/1.1 rather than HTTP\/1.0 by default.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9869\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-3.png\" alt=\"standard php library\" width=\"572\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-3.png 572w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-3-300x47.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">substr(),\u00a0mb_substr(),\u00a0iconv_substr()\u00a0and\u00a0grapheme_substr()<\/span><\/em>\u00a0now consistently clamp out-of-bounds offsets to the string boundary.<\/li>\n<li>the program execution functions <span style=\"color: #3366ff;\">(proc_open(),\u00a0exec(),\u00a0popen()\u00a0etc.)<\/span> on Windows and have the same effect as executing\u00a0$commandline.<\/li>\n<li>Calling\u00a0<em><span style=\"color: #3366ff;\">crypt()<\/span><\/em>\u00a0without an explicit salt is no longer supported.<\/li>\n<\/ul>\n<p><strong>Sysvsem<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">auto_release<\/span><\/em>\u00a0parameter of\u00a0<em><span style=\"color: #3366ff;\">sem_get()<\/span><\/em>\u00a0can now accept Boolean values rather than Integers.<\/li>\n<\/ul>\n<p><strong>Tidy<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">tidy_repair_string()<\/span><\/em> do not contain <em><span style=\"color: #3366ff;\">use_include_path<\/span><\/em>\u00a0parameter.<\/li>\n<li><em><span style=\"color: #3366ff;\">tidy::repairString()<\/span><\/em>\u00a0and\u00a0<em><span style=\"color: #3366ff;\">tidy::repairFile()<\/span><\/em> are static methods now.<\/li>\n<\/ul>\n<p><strong>Tokenizer\u00a0<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">T_COMMENT<\/span><\/em>\u00a0tokens do not include a trailing newline. The newline is now a part of the T_WHITESPACE token, Whitespace or <em><span style=\"color: #3366ff;\">T_CLOSE_TAG\u00a0or end-of-file follows T_COMMENT<\/span><\/em>.<\/li>\n<li><em><span style=\"color: #3366ff;\">T_NAME_QUALIFIED<\/span><\/em>\u00a0<span style=\"color: #3366ff;\">(Foo\\Bar),\u00a0T_NAME_FULLY_QUALIFIED\u00a0(\\Foo\\Bar)<\/span> and\u00a0<span style=\"color: #3366ff;\">T_NAME_RELATIVE\u00a0(namespace\\Foo\\Bar)<\/span> tokens are used to represent Namespaced names.<\/li>\n<li>Standalone namespace separators use: <span style=\"color: #3366ff;\">T_NS_SEPARATOR<\/span><\/li>\n<\/ul>\n<p><strong>XMLReader<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">XMLReader::open()<\/span> and <span style=\"color: #3366ff;\">XMLReader::xml()<\/span> are instance and inheriting classes need to declare these as static if they override methods.<\/li>\n<\/ul>\n<p><strong>XML-RPC<\/strong><\/p>\n<ul>\n<li>XML-RPC extension is now part of PECL.<\/li>\n<\/ul>\n<p><strong>Zip<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">ZipArchive::OPSYS_CPM<\/span>\u00a0replaces <span style=\"color: #3366ff;\">ZipArchive::OPSYS_Z_CPM<\/span><\/li>\n<\/ul>\n<p><strong>Zlib<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">gzgetss()<\/span> no longer exists.<\/li>\n<li><span style=\"color: #3366ff;\">output_compression<\/span> is disabled for Content-Type: <span style=\"color: #3366ff;\">image\/*<\/span>.<\/li>\n<\/ul>\n<p><strong>Windows PHP Test Packs<\/strong><\/p>\n<ul>\n<li><span style=\"color: #3366ff;\">run-test.php<\/span>\u00a0is now known as run-tests.php.<\/li>\n<\/ul>\n<p><strong>PHP Core<\/strong><\/p>\n<ul>\n<li>PHP 8 drops the default value as the required parameter follows it. The functionality remains intact.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9864\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-core-1.png\" alt=\"php core\" width=\"340\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-core-1.png 340w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-core-1-300x60.png 300w\" sizes=\"(max-width: 340px) 100vw, 340px\" \/><\/p>\n<ul>\n<li>It comes with an exception: <em>Type $param = null<\/em> (null default makes the type implicitly nullable), the explicit nullable type is preferable.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9865\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-core-2.png\" alt=\"php core\" width=\"430\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-core-2.png 430w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-core-2-300x50.png 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">get_defined_functions()<\/span><\/em> does not include disabled functions.<\/li>\n<li><em><span style=\"color: #3366ff;\">get_defined_functions()<\/span><\/em>\u00a0with\u00a0<em><span style=\"color: #3366ff;\">exclude_disabled<\/span><\/em>, set to false, is deprecated.<\/li>\n<\/ul>\n<p><strong>Enchant<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">ENCHANT_MYSPELL\u00a0and\u00a0ENCHANT_ISPELL<\/span><\/em>\u00a0is deprecated.<\/li>\n<li><span style=\"color: #3366ff;\">enchant_broker_set_dict_path(),enchant_broker_get_dict_path()<\/span> \u2013 as this functionality is not available in libenchant &lt; 1.5 or in libenchant-2.<\/li>\n<li><em><span style=\"color: #3366ff;\">enchant_dict_add()<\/span><\/em> replaces <em><span style=\"color: #3366ff;\">enchant_dict_add_to_personal()<\/span><\/em><\/li>\n<li>enchant_dict_is_added() replaces <em><span style=\"color: #3366ff;\">enchant_dict_is_in_session()<\/span><\/em><\/li>\n<li>Unset the object as <em><span style=\"color: #3366ff;\">enchant_broker_free()<\/span><\/em>\u00a0and\u00a0<em><span style=\"color: #3366ff;\">enchant_broker_free_dict()<\/span><\/em>\u00a0are deprecated.<\/li>\n<\/ul>\n<p><strong>LibXML<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">libxml_disable_entity_loader()<\/span><\/em>\u00a0is now deprecated.<\/li>\n<li>libxml 2.9.0 is required which guarantees entity loading and thereby protecting against XXE attacks.<\/li>\n<\/ul>\n<p><strong>PGSQL \/ PDO PGSQL<\/strong><\/p>\n<ul>\n<li>PGSQL_LIBPQ_VERSION_STR\u00a0is deprecated.<\/li>\n<li>Function aliases deprecate in PHP 8.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9863\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/pgsql.png\" alt=\"pgsql\" width=\"223\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/pgsql.png 223w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/pgsql-145x300.png 145w\" sizes=\"(max-width: 223px) 100vw, 223px\" \/><\/p>\n<p><strong>Standard Library<\/strong><\/p>\n<ul>\n<li>An implementation that returns an integer (&lt;, =, &gt; zero) replaces the sort comparison functions append with a deprecation warning.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9870\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-4.png\" alt=\"standard php library\" width=\"344\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-4.png 344w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/standard-library-4-300x87.png 300w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/p>\n<p><strong>Zip<\/strong><\/p>\n<ul>\n<li><em><span style=\"color: #3366ff;\">ZipArchive<\/span><\/em> is deprecated. Instead, a Null\/empty file is applicable.<\/li>\n<li><em><span style=\"color: #3366ff;\">ZipArchive<\/span><\/em><strong><em>\u00a0<\/em><\/strong>is used instead of the procedural API of zipping as it is deprecated.<\/li>\n<li><em><span style=\"color: #3366ff;\">ZipArchive::statIndex() <\/span><\/em>and a for loop is used for iteration overall entries.<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-9873\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip-2.png\" alt=\"zip\" width=\"415\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip-2.png 415w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/zip-2-300x150.png 300w\" sizes=\"(max-width: 415px) 100vw, 415px\" \/><\/p>\n<p><strong>Reflection<\/strong><\/p>\n<p><em><span style=\"color: #3366ff;\">ReflectionParameter::getType()<\/span>\u00a0and the\u00a0<span style=\"color: #3366ff;\">ReflectionType<\/span>\u00a0APIs can be used as <span style=\"color: #3366ff;\">ReflectionFunction::isDisabled()<\/span>, <span style=\"color: #3366ff;\">ReflectionParameter::getClass()<\/span>,\u00a0<span style=\"color: #3366ff;\">ReflectionParameter::isArray()<\/span>, <span style=\"color: #3366ff;\">ReflectionParameter::isCallable()<\/span>\u00a0are deprecated.\u00a0<\/em><\/p>\n<h2>Challenges with PHP 8.0<\/h2>\n<ul>\n<li>Existing WordPress projects need to migrate to PHP 8.0. Well-types codebases run smoothly with upcoming versions of PHP. Everything else requires migration to avoid breakage.<\/li>\n<li>There are issues with standard WordPress installation with PHP 8.<\/li>\n<li>PHP 8 comes with many compatibility issues.<\/li>\n<\/ul>\n<p>Create a backup before testing the new version of the WordPress website with PHP 8. Developers need to take a leap of faith and dive into PHP development with WordPress as it is better-off than previous versions.<\/p>\n<h2>Conclusive: Are we ready to embrace changes with PHP 8.0?<\/h2>\n<p>We learned that PHP 8.0 brings in major changes to &#8211; <em>The JIT compiler; Attributes; Named arguments; Match expressions; Throw expressions (rfc) \u2013 Arrow functions, Coalesce Operators, Ternary Operators; Static return type(rfc); Union type(rfc) and Mixed types (rfc); and other interesting features like &#8211; Make Sorting Stable(rfc); Constructor Property Promotion(rfc); Zero Safe Operator(rfc); str_contains(rfc); Weak Maps(rfc); Non-capturing Catches(rfc);<\/em><\/p>\n<p>Including a word of caution here, developers should consider updating after testing once a stable release is available every year with your WordPress Hosting Provider. PHP progresses naturally. And, before we explore the one at hand, a new version becomes available with updates. Decide the way you wish to proceed with the performance and growth of your business. We endure <a href=\"https:\/\/www.konstantinfo.com\/php-web-development\" target=\"_blank\">PHP development services<\/a> within budget. <a href=\"https:\/\/www.konstantinfo.com\/hire-dedicated-developer\" target=\"_blank\">Hire PHP developers<\/a> on dedicated or outsourcing models.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP 8 was officially released on November 20, 2021. PHP 8.0 is the latest version of PHP (updated February 2021). It brings in advanced security, more than PHP 7.4 and older versions. It comes with major issue fixes and performance improvements for WordPress sites. We&#8217;re about to discuss major features, shortcomings and trends that PHP&hellip; <a class=\"more-link\" href=\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/\">Continue reading <span class=\"screen-reader-text\">PHP 8 Features, Challenges, Trends in 2021<\/span><\/a><\/p>\n","protected":false},"author":21,"featured_media":9847,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[1540],"class_list":["post-9835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-php-8-features","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP 8 Features, Challenges, Trends in 2021 - Konstantinfo<\/title>\n<meta name=\"description\" content=\"This excerpt discusses about major PHP 8 features, the trends and challenges follow. We channel a fall back plan for PHP development services, check out our portfolio!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP 8 Features, Challenges, Trends in 2021 - Konstantinfo\" \/>\n<meta property=\"og:description\" content=\"This excerpt discusses about major PHP 8 features, the trends and challenges follow. We channel a fall back plan for PHP development services, check out our portfolio!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/\" \/>\n<meta property=\"og:site_name\" content=\"Konstantinfo\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/konstant.info\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-25T12:34:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-17T07:33:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1008\" \/>\n\t<meta property=\"og:image:height\" content=\"448\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Neeti Kotia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@konstantinfo\" \/>\n<meta name=\"twitter:site\" content=\"@konstantinfo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Neeti Kotia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/\",\"name\":\"PHP 8 Features, Challenges, Trends in 2021 - Konstantinfo\",\"isPartOf\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg\",\"datePublished\":\"2021-02-25T12:34:27+00:00\",\"dateModified\":\"2021-11-17T07:33:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9\"},\"description\":\"This excerpt discusses about major PHP 8 features, the trends and challenges follow. We channel a fall back plan for PHP development services, check out our portfolio!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#primaryimage\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg\",\"contentUrl\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg\",\"width\":1008,\"height\":448,\"caption\":\"php 8 features\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP 8 Features, Challenges, Trends in 2021\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#website\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/\",\"name\":\"Konstantinfo\",\"description\":\"Welcome to Konstant Info\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9\",\"name\":\"Neeti Kotia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg\",\"contentUrl\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg\",\"caption\":\"Neeti Kotia\"},\"description\":\"Neeti Kotia is a technology journalist who seeks to analyze the advancements and developments in technology that affect our everyday lives. Her articles primarily focus upon the business, social, cultural, and entertainment side of the technology sector.\",\"sameAs\":[\"http:\/\/www.konstantinfo.com\",\"http:\/\/www.facebook.com\/konstant.info\",\"https:\/\/x.com\/konstantinfo\"],\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/author\/neeti-kotia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP 8 Features, Challenges, Trends in 2021 - Konstantinfo","description":"This excerpt discusses about major PHP 8 features, the trends and challenges follow. We channel a fall back plan for PHP development services, check out our portfolio!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/","og_locale":"en_US","og_type":"article","og_title":"PHP 8 Features, Challenges, Trends in 2021 - Konstantinfo","og_description":"This excerpt discusses about major PHP 8 features, the trends and challenges follow. We channel a fall back plan for PHP development services, check out our portfolio!","og_url":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/","og_site_name":"Konstantinfo","article_author":"http:\/\/www.facebook.com\/konstant.info","article_published_time":"2021-02-25T12:34:27+00:00","article_modified_time":"2021-11-17T07:33:39+00:00","og_image":[{"width":1008,"height":448,"url":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg","type":"image\/jpeg"}],"author":"Neeti Kotia","twitter_card":"summary_large_image","twitter_creator":"@konstantinfo","twitter_site":"@konstantinfo","twitter_misc":{"Written by":"Neeti Kotia","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/","name":"PHP 8 Features, Challenges, Trends in 2021 - Konstantinfo","isPartOf":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#primaryimage"},"image":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#primaryimage"},"thumbnailUrl":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg","datePublished":"2021-02-25T12:34:27+00:00","dateModified":"2021-11-17T07:33:39+00:00","author":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9"},"description":"This excerpt discusses about major PHP 8 features, the trends and challenges follow. We channel a fall back plan for PHP development services, check out our portfolio!","breadcrumb":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#primaryimage","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg","contentUrl":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/02\/php-8.jpg","width":1008,"height":448,"caption":"php 8 features"},{"@type":"BreadcrumbList","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/php-8-features\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.konstantinfo.com\/konstant-blog\/"},{"@type":"ListItem","position":2,"name":"PHP 8 Features, Challenges, Trends in 2021"}]},{"@type":"WebSite","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#website","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/","name":"Konstantinfo","description":"Welcome to Konstant Info","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.konstantinfo.com\/konstant-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9","name":"Neeti Kotia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg","contentUrl":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg","caption":"Neeti Kotia"},"description":"Neeti Kotia is a technology journalist who seeks to analyze the advancements and developments in technology that affect our everyday lives. Her articles primarily focus upon the business, social, cultural, and entertainment side of the technology sector.","sameAs":["http:\/\/www.konstantinfo.com","http:\/\/www.facebook.com\/konstant.info","https:\/\/x.com\/konstantinfo"],"url":"https:\/\/www.konstantinfo.com\/konstant-blog\/author\/neeti-kotia\/"}]}},"show_toc":false,"table_of_content":[],"faq":[],"related_blogs":[{"id":11095,"title":"How to Build a Real Estate Website &#8211; A Detailed Guide","slug":"build-real-estate-website","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/build-real-estate-website\/","modified":"2026-05-07 17:49:50","excerpt":"\u201cWebsites promote you 24\/7: No employee will do that.\u201d \u2013 Paul Cookson This powerful quote by the popular writer, Paul...","image":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2024\/10\/build-a-real-estate-website.webp"},{"id":6850,"title":"Hiring a Skilled and Experienced Nodejs Developer is Easy; Determine Cost Factors!","slug":"cost-to-hire-a-nodejs-developer","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/cost-to-hire-a-nodejs-developer\/","modified":"2026-05-04 13:23:21","excerpt":"After spending two days on research, there is no doubt in my mind about the power that node provides to...","image":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/09\/Nodejs-Developer-1-300x133.jpg"},{"id":12577,"title":"10 Top Web Development Companies 2026","slug":"web-development-companies","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/web-development-companies\/","modified":"2026-04-29 18:23:08","excerpt":"A successful web development solution depends on your project requirements and web developers' services. When you have an innovative idea...","image":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2026\/01\/top-web-development-companies-300x133.webp"}],"_links":{"self":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts\/9835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/comments?post=9835"}],"version-history":[{"count":1,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts\/9835\/revisions"}],"predecessor-version":[{"id":10400,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts\/9835\/revisions\/10400"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/media\/9847"}],"wp:attachment":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/media?parent=9835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/categories?post=9835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/tags?post=9835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}