{"id":7940,"date":"2021-10-21T15:54:28","date_gmt":"2021-10-21T15:54:28","guid":{"rendered":"https:\/\/hosting4agency.com\/green-hosting\/php-8-1-functions-and-new-features-you-should-know\/"},"modified":"2026-06-05T22:28:50","modified_gmt":"2026-06-05T22:28:50","slug":"php-8-1-functions-and-new-features-you-should-know","status":"publish","type":"post","link":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/","title":{"rendered":"PHP 8.1: functions and new features you should know"},"content":{"rendered":"\n<p>The <strong>PHP<\/strong> (<em>Hypertext Preprocessor<\/em>) is the programming language that forms the basis of many common <strong>content management systems<\/strong> of the web (<em>WordPress, Drupal, Joomla, Magento, &#8230;<\/em>), as well as various frameworks for creating <strong>web applications<\/strong> (<em>Laminas, Laravel, Symfony, CodeIgniter\u2026<\/em>).<\/p>\n\n<p>After 26 years of life (the first version of PHP was written by <strong>Rasmus Lerdorf<\/strong>, Danish-Canadian programmer, in the distant 1994!), PHP continues to renew itself and be one of the indispensable standards in web development.<\/p>\n\n<p>The most recent upgrade of PHP is currently in development and will be officially distributed on <strong>25 November 2021<\/strong>, the date scheduled for the release of the version <em>General Availability (GA)<\/em>, i.e., that considered stable, following a long series of preliminary versions (<em>alpha, beta<\/em>, and <em>Release Candidate<\/em>), as we can read in the <a href=\"https:\/\/wiki.php.net\/todo\/php81\" target=\"_blank\" rel=\"noreferrer noopener\">PHP Wiki Todo (&#8220;things to do&#8221;) page<\/a>.<\/p>\n\n<div class=\"wp-block-group has-background is-layout-flow wp-block-group-is-layout-flow\" style=\"background-color:#f2f2f2\">\n<p><strong>Table of contents<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#jit\">JIT (Just In Time Compiler)<\/a><\/li>\n\n\n\n<li><a href=\"#fibers\">Fibers<\/a><\/li>\n\n\n\n<li><a href=\"#inheritance-cache\">Inheritance Cache<\/a><\/li>\n\n\n\n<li><a href=\"#intersection-types\">Intersection Types<\/a><\/li>\n\n\n\n<li><a href=\"#summary\">PHP 8.1: How can we assist you<\/a><\/li>\n<\/ul>\n<\/div>\n\n<div style=\"height:10px\" aria-hidden=\"true\" id=\"jit\" class=\"wp-block-spacer\"><\/div>\n\n<h2 class=\"wp-block-heading\">JIT (Just In Time Compiler)<\/h2>\n\n<p>Va bene, we have a bit &#8220;barato&#8221;. The JIT has been introduced in PHP version 8.0, and actually in 8.1 there will be at most minor bugfixes (corrections).<\/p>\n\n<p>Talking about the PHP 8.x series but not mentioning what has been the greatest revolution of this language in recent years would be practically impossible. What are we talking about?<br\/><br\/>When we say JIT, we refer to the <strong>Just-in-time (JIT)<\/strong> compiler.<\/p>\n\n<p>PHP JIT is implemented as a nearly independent part of the shared memory <strong>OPcache<\/strong> (on which we will return in a few lines). It can be enabled or disabled at compile-time of the programs (scripts) in PHP and also at execution time.<\/p>\n\n<p>When enabled, the source code of PHP files is stored in an additional region of OPcache. So, how did we get to JIT and what is the difference between JIT and OPcache?<\/p>\n\n<p>First of all, let&#8217;s keep in mind that the execution of PHP is a process in 4 phases:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>Lexing\/Tokenization<\/strong>: first, the interpreter reads the PHP code and creates a set of derived objects called tokens.<\/li>\n\n\n\n<li><strong>Parsing<\/strong>: the interpreter verifies if the script matches the language syntax rules and uses tokens to build a <strong>Abstract Syntax Tree (AST)<\/strong>, a hierarchical representation of the source code structure.<\/li>\n\n\n\n<li><strong>Compilation<\/strong>: the interpreter traverses the tree and translates the nodes (i.e., the leaves of the AST hierarchy) into low-level <strong>opcode<\/strong> codes, that is, numerical identifiers that determine the type of instruction.<\/li>\n\n\n\n<li><strong>Interpretation<\/strong>: the opcodes are interpreted and executed on the <strong>Zend Virtual Machine (VM)<\/strong>.<\/li>\n<\/ul>\n\n<p>Now, the <strong>opcode<\/strong>s to which we have referred are low-level intermediate representations, but they still need to be compiled into machine code, understandable by the processor (CPU). The JIT does not introduce any additional <strong>IR module (Intermediate Representation)<\/strong>, but rather uses the <strong>DynASM (Dynamic Assembler for code generation engines<\/strong>) to generate source code directly from PHP opcodes.<\/p>\n\n<p>In practice, what the JIT does is <strong>bypass the compilation<\/strong>, allowing code to be executed directly from the CPU and without having to go through the Zend Virtual Machine, bringing notable improvements to performance and memory usage as Zeev Surasky, co-author of the original proposal, has argued.<\/p>\n\n<p>At the moment, the benefits for &#8220;user apps&#8221; like <em>WordPress<\/em> will be limited, but the true final goal of JIT is to increase the potential usage of PHP 8.1: bringing it to some <strong>low-level computation capabilities that bring it closer to languages like C<\/strong>.<\/p>\n\n<p>This last one &#8211; despite being extremely more complex to use and with its 49 years on the shoulders! &#8211; remains almost a mandatory choice when computational speed is the project&#8217;s focal point.<\/p>\n\n<div style=\"height:10px\" aria-hidden=\"true\" id=\"fibers\" class=\"wp-block-spacer\"><\/div>\n\n<h2 class=\"wp-block-heading\">Novelties in PHP 8.1: Fibers<\/h2>\n\n<p>The <strong>fibers<\/strong>, also known as <strong>green threads<\/strong>, are a low-level mechanism for managing the <strong>operation parallelism<\/strong>. For most of PHP&#8217;s history, programmers have written synchronous code: the execution of functions (also called procedures) is halted until a result is available to return, even for I\/O operations (Input \/ Output), which can be quite slow.<\/p>\n\n<p>More recently, there have been more projects that have allowed writing <strong>asynchronous PHP code<\/strong> to enable simultaneous I\/O operations, i.e., where execution can continue without having to wait for a result from a previous &#8220;step&#8221;.<br\/><br\/>The <strong>fibers<\/strong> are one of these projects, and although they may not be used directly in &#8220;user-facing&#8221; projects, they will still be adopted by specific <strong>libraries<\/strong> like <em>Guzzle, ReactPHP<\/em> and <em>Amp<\/em>, which are actually used by developers.<\/p>\n\n<div style=\"height:10px\" aria-hidden=\"true\" id=\"inheritance-cache\" class=\"wp-block-spacer\"><\/div>\n\n<h2 class=\"wp-block-heading\">Novelties PHP 8.1: Inheritance Cache<\/h2>\n\n<p>The <strong>PHP cache (opcache)<\/strong> &#8211; which allows for some files to be available in a &#8220;fast memory&#8221; so they do not have to be re-read from scratch on every code execution &#8211; has been improved by <strong>Dmitry Stogov<\/strong>, one of the main <em>core developers<\/em> working on PHP, with an inheritance caching mechanism.<\/p>\n\n<p>Thanks to its new creation, when in our programs we will declare classes (which are one of the fundamental concepts of so-called <strong>object-oriented programming<\/strong>) and these classes &#8220;inherit&#8221; characteristics from other classes as well (parent-child relationship), the existence of this link will be &#8220;memorable&#8221;. This change adds to the already introduced possibility of <strong>pre-loading classes<\/strong> in PHP 7.4.<br\/><br\/>The final outcome is the same we expect also from fibers: faster websites and applications for end-users.<\/p>\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n<div class=\"wp-block-group contact-banner-blog has-background is-layout-flow wp-block-group-is-layout-flow\" style=\"background:linear-gradient(-30deg,rgb(255,82,82) 0%,rgb(112,63,125) 63%,rgb(40,53,147) 100%)\">\n<p class=\"has-text-align-center has-white-color has-text-color\" style=\"font-size:20px\">Try Hosting4Agency on a site of your choice for 30 days and compare the performance before\/after the trial period!<\/p>\n\n\n\n<div class=\"wp-block-buttons is-horizontal is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-03627597 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/hosting4agency.com\/en\/custom-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Try for free!<\/a><\/div>\n<\/div>\n<\/div>\n\n<div style=\"height:10px\" aria-hidden=\"true\" id=\"intersection-types\" class=\"wp-block-spacer\"><\/div>\n\n<h2 class=\"wp-block-heading\">New PHP 8.1 Functions: Intersection Types<\/h2>\n\n<p>Now, for our more &#8220;restless&#8221; readers, given that we are talking about a programming language, let&#8217;s get into the detail of a modification that directly concerns the way of writing code, introduced among the novelties of version 8.1: support for <strong>intersection types<\/strong>.<\/p>\n\n<p>To better understand its usage, let&#8217;s first keep in mind that it is possible to add <strong>type declarations<\/strong> to the arguments of our functions, i.e., to those variable parameters that &#8220;we feed&#8221; to our code, as well as to the values these procedures return.<\/p>\n\n<p>This assignment, also called <strong>type hinting<\/strong> (\u201csuggestion of type\u201d), guarantees that the value is of the correct type (data \/ text string \/ integer number \/ decimal number \/ class or type interface \u201cwho knows\u201d) at the time of the call.<\/p>\n\n<p>If however this requirement is not met and we find ourselves for example with text when we expect a date, thanks to type hinting an error of the category <strong>TypeError<\/strong> is generated immediately. In turn, this helps us better debug the code, that is, to identify lurking errors that could come back to bite us in the long term.<\/p>\n\n<p>However, declaring a single type has its limitations, and the <strong>union types<\/strong> (introduced in PHP 8.0) help us overcome this issue by allowing us to declare a value with multiple types: the input will need to satisfy at least one of them.<\/p>\n\n<p>Now in PHP 8.1, we will also have <strong>intersection types<\/strong> that require satisfying more than one requirement. The classic case is that of classes implementing multiple interfaces. <br\/>For a very generic example, in our software there might be a class \u201cAsus\u201d, which implements (i.e., actually realizes) not just one but two different abstract models (the so-called <strong>interfaces<\/strong>), namely \u201cTelefono\u201d, where the fundamental functionality is that of calling, and \u201cOggettoCool\u201d, which instead will have to have a completely different nature, with its own operating system and everything we expect from a modern smartphone.<\/p>\n\n<div style=\"height:10px\" aria-hidden=\"true\" id=\"riepilogo\" class=\"wp-block-spacer\"><\/div>\n\n<h2 class=\"wp-block-heading\">PHP 8.1: How can we assist you<\/h2>\n\n<p>Sappiamo quanto sia importante specialmente nel nostro settore essere sempre all&#8217;avanguardia sotto ogni aspetto, per cui supportiamo gi\u00e0 il PHP 8.0, e il 25 novembre 2021 non ci faremo di certo trovare impreparati per la versione PHP 8.1!<\/p>\n\n<p>Anzi, saremo tra i primi ad averla a disposizione, pronta all\u2019uso, per tutte le agenzie a cui forniamo servizi e che la desiderano.<\/p>\n\n<p>The infrastructure of <strong>Hosting 4 Agency<\/strong> &#8211; concerning PHP &#8211; allows us to coexist on the same server any version of PHP we wish to have and assign it to a whole resource zone, which corresponds to a folder with just a few clicks.<\/p>\n\n<p>Any site or application underneath that point of the filesystem will &#8220;run&#8221; (as we say in jargon) with the desired PHP.<\/p>\n\n<p>If you manage one or more websites and want to be sure they are <strong>always protected, fast and updated promptly to the most innovative solutions<\/strong>, we can take care of it for you, lifting any type of worry and time loss off your shoulders. <strong>To learn more, take a look at our <a href=\"https:\/\/hosting4agency.com\/en\/custom-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">packages<\/a>!<\/strong><\/p>\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n<h4 class=\"wp-block-heading\">Continue reading<\/h4>\n\n<div class=\"wp-block-query is-layout-flow wp-block-query-is-layout-flow\"><ul class=\"wp-block-post-template is-layout-flow wp-block-post-template-is-layout-flow\"><li class=\"wp-block-post post-8250 post type-post status-publish format-standard has-post-thumbnail hentry category-green-hosting category-safe-hosting tag-agencies tag-helpdesk tag-web-security\">\n<h5 class=\"wp-block-post-title\"><a href=\"https:\/\/hosting4agency.com\/en\/green-hosting\/stop-being-the-sysadmin-the-5-alarm-bells-that-tell-you-when-to-delegate-your-agencys-server-management\/\" target=\"_blank\" >Stop being the sysadmin: The 5 alarm bells that tell you when to delegate your agency&#8217;s server management<\/a><\/h5>\n<\/li><li class=\"wp-block-post post-8253 post type-post status-publish format-standard has-post-thumbnail hentry category-wordpress-hosting tag-agencies tag-ai tag-web-development\">\n<h5 class=\"wp-block-post-title\"><a href=\"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/automatic-website-translation-for-web-agency-the-zero-api-approach-of-hosting4agency\/\" target=\"_blank\" >Automatic Website Translation for Web Agency: The &#8220;Zero API&#8221; Approach of Hosting4Agency<\/a><\/h5>\n<\/li><li class=\"wp-block-post post-8255 post type-post status-publish format-standard has-post-thumbnail hentry category-green-hosting tag-agencies tag-ai tag-sustainable-hosting\">\n<h5 class=\"wp-block-post-title\"><a href=\"https:\/\/hosting4agency.com\/en\/green-hosting\/digital-sustainability-enterprise-how-to-combine-performance-compliance-esg-and-100-green-hosting\/\" target=\"_blank\" >Digital Sustainability Enterprise: How to Combine Performance, Compliance ESG and 100% Green Hosting<\/a><\/h5>\n<\/li><\/ul>\n\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will describe the <b>essential novelties<\/b> of the new PHP 8.1 and the new possibilities that will open up for developers <em>(back-end developers)<\/em> working with this technology, as well as for website and application owners using this language <em>(PHP-based projects).<\/em><\/p>\n","protected":false},"author":1,"featured_media":2552,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,116],"tags":[163,169],"class_list":["post-7940","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-green-hosting","category-wordpress-hosting","tag-high-performance-hosting","tag-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP 8.1: functions and new features you should know - Hosting4Agency<\/title>\n<meta name=\"description\" content=\"In this article, we will describe the essential new features of the new PHP 8.1 and the new possibilities that will open up for developers (back-end developers) working with this technology, as well as for website and application owners using this language (PHP-based projects).\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP 8.1: functions and new features you should know - Hosting4Agency\" \/>\n<meta property=\"og:description\" content=\"In this article, we will describe the essential new features of the new PHP 8.1 and the new possibilities that will open up for developers (back-end developers) working with this technology, as well as for website and application owners using this language (PHP-based projects).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/\" \/>\n<meta property=\"og:site_name\" content=\"Hosting4Agency\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hosting4agency\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-21T15:54:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-05T22:28:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/10\/Hosting-4-Agency-novita-su-php-8-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hosting 4 Agency\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hosting 4 Agency\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/\"},\"author\":{\"name\":\"Hosting 4 Agency\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#\\\/schema\\\/person\\\/0973c5551c8bcc591a92709a381e1bed\"},\"headline\":\"PHP 8.1: functions and new features you should know\",\"datePublished\":\"2021-10-21T15:54:28+00:00\",\"dateModified\":\"2026-06-05T22:28:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/\"},\"wordCount\":1387,\"publisher\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hosting4agency.com\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/Hosting-4-Agency-novita-su-php-8-1.jpg\",\"keywords\":[\"High-Performance Hosting\",\"Web Development\"],\"articleSection\":[\"Hosting\",\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/\",\"url\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/\",\"name\":\"PHP 8.1: functions and new features you should know - Hosting4Agency\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hosting4agency.com\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/Hosting-4-Agency-novita-su-php-8-1.jpg\",\"datePublished\":\"2021-10-21T15:54:28+00:00\",\"dateModified\":\"2026-06-05T22:28:50+00:00\",\"description\":\"In this article, we will describe the essential new features of the new PHP 8.1 and the new possibilities that will open up for developers (back-end developers) working with this technology, as well as for website and application owners using this language (PHP-based projects).\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hosting4agency.com\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/Hosting-4-Agency-novita-su-php-8-1.jpg\",\"contentUrl\":\"https:\\\/\\\/hosting4agency.com\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/Hosting-4-Agency-novita-su-php-8-1.jpg\",\"width\":1200,\"height\":800,\"caption\":\"php 8.1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/wordpress-hosting\\\/php-8-1-functions-and-new-features-you-should-know\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP 8.1: functions and new features you should know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/\",\"name\":\"Hosting 4 Agency\",\"description\":\"Hosting B2B2B per Agenzie\",\"publisher\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#organization\"},\"alternateName\":\"H4A\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#organization\",\"name\":\"Hosting4Agency\",\"url\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/hosting4agency.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/cropped-H4A-logo-colori-negativo.png\"},\"image\":{\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/elan42.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/elan42\\\/\"],\"legalName\":\"E42 S.r.l.\",\"vatID\":\"IT04439760275\",\"taxID\":\"04439760275\",\"telephone\":\"+390413034754\",\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":\"Dorsoduro 3649\",\"addressLocality\":\"Venezia\",\"postalCode\":\"30123\",\"addressRegion\":\"VE\",\"addressCountry\":\"IT\"},\"contactPoint\":{\"@type\":\"ContactPoint\",\"contactType\":\"technical support\",\"telephone\":\"+390413034754\",\"email\":\"info@elan42.com\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hosting4agency.com\\\/en\\\/#\\\/schema\\\/person\\\/0973c5551c8bcc591a92709a381e1bed\",\"name\":\"Hosting 4 Agency\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5ca6e046df97fda2d2ad39ad1d2a68842b251ad3d0d94627063cc12b7ca65579?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5ca6e046df97fda2d2ad39ad1d2a68842b251ad3d0d94627063cc12b7ca65579?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5ca6e046df97fda2d2ad39ad1d2a68842b251ad3d0d94627063cc12b7ca65579?s=96&d=mm&r=g\",\"caption\":\"Hosting 4 Agency\"},\"sameAs\":[\"https:\\\/\\\/hosting4agency.com\\\/new.hosting4agency.com\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP 8.1: functions and new features you should know - Hosting4Agency","description":"In this article, we will describe the essential new features of the new PHP 8.1 and the new possibilities that will open up for developers (back-end developers) working with this technology, as well as for website and application owners using this language (PHP-based projects).","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:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/","og_locale":"en_US","og_type":"article","og_title":"PHP 8.1: functions and new features you should know - Hosting4Agency","og_description":"In this article, we will describe the essential new features of the new PHP 8.1 and the new possibilities that will open up for developers (back-end developers) working with this technology, as well as for website and application owners using this language (PHP-based projects).","og_url":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/","og_site_name":"Hosting4Agency","article_publisher":"https:\/\/www.facebook.com\/hosting4agency","article_published_time":"2021-10-21T15:54:28+00:00","article_modified_time":"2026-06-05T22:28:50+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/10\/Hosting-4-Agency-novita-su-php-8-1.jpg","type":"image\/jpeg"}],"author":"Hosting 4 Agency","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Hosting 4 Agency","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#article","isPartOf":{"@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/"},"author":{"name":"Hosting 4 Agency","@id":"https:\/\/hosting4agency.com\/en\/#\/schema\/person\/0973c5551c8bcc591a92709a381e1bed"},"headline":"PHP 8.1: functions and new features you should know","datePublished":"2021-10-21T15:54:28+00:00","dateModified":"2026-06-05T22:28:50+00:00","mainEntityOfPage":{"@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/"},"wordCount":1387,"publisher":{"@id":"https:\/\/hosting4agency.com\/en\/#organization"},"image":{"@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#primaryimage"},"thumbnailUrl":"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/10\/Hosting-4-Agency-novita-su-php-8-1.jpg","keywords":["High-Performance Hosting","Web Development"],"articleSection":["Hosting","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/","url":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/","name":"PHP 8.1: functions and new features you should know - Hosting4Agency","isPartOf":{"@id":"https:\/\/hosting4agency.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#primaryimage"},"image":{"@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#primaryimage"},"thumbnailUrl":"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/10\/Hosting-4-Agency-novita-su-php-8-1.jpg","datePublished":"2021-10-21T15:54:28+00:00","dateModified":"2026-06-05T22:28:50+00:00","description":"In this article, we will describe the essential new features of the new PHP 8.1 and the new possibilities that will open up for developers (back-end developers) working with this technology, as well as for website and application owners using this language (PHP-based projects).","breadcrumb":{"@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#primaryimage","url":"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/10\/Hosting-4-Agency-novita-su-php-8-1.jpg","contentUrl":"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/10\/Hosting-4-Agency-novita-su-php-8-1.jpg","width":1200,"height":800,"caption":"php 8.1"},{"@type":"BreadcrumbList","@id":"https:\/\/hosting4agency.com\/en\/wordpress-hosting\/php-8-1-functions-and-new-features-you-should-know\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hosting4agency.com\/en\/"},{"@type":"ListItem","position":2,"name":"PHP 8.1: functions and new features you should know"}]},{"@type":"WebSite","@id":"https:\/\/hosting4agency.com\/en\/#website","url":"https:\/\/hosting4agency.com\/en\/","name":"Hosting 4 Agency","description":"Hosting B2B2B per Agenzie","publisher":{"@id":"https:\/\/hosting4agency.com\/en\/#organization"},"alternateName":"H4A","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hosting4agency.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hosting4agency.com\/en\/#organization","name":"Hosting4Agency","url":"https:\/\/hosting4agency.com\/en\/","logo":{"@type":"ImageObject","url":"https:\/\/hosting4agency.com\/wp-content\/uploads\/2021\/08\/cropped-H4A-logo-colori-negativo.png"},"image":{"@id":"https:\/\/hosting4agency.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/elan42.com\/","https:\/\/www.linkedin.com\/company\/elan42\/"],"legalName":"E42 S.r.l.","vatID":"IT04439760275","taxID":"04439760275","telephone":"+390413034754","address":{"@type":"PostalAddress","streetAddress":"Dorsoduro 3649","addressLocality":"Venezia","postalCode":"30123","addressRegion":"VE","addressCountry":"IT"},"contactPoint":{"@type":"ContactPoint","contactType":"technical support","telephone":"+390413034754","email":"info@elan42.com"}},{"@type":"Person","@id":"https:\/\/hosting4agency.com\/en\/#\/schema\/person\/0973c5551c8bcc591a92709a381e1bed","name":"Hosting 4 Agency","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5ca6e046df97fda2d2ad39ad1d2a68842b251ad3d0d94627063cc12b7ca65579?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5ca6e046df97fda2d2ad39ad1d2a68842b251ad3d0d94627063cc12b7ca65579?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5ca6e046df97fda2d2ad39ad1d2a68842b251ad3d0d94627063cc12b7ca65579?s=96&d=mm&r=g","caption":"Hosting 4 Agency"},"sameAs":["https:\/\/hosting4agency.com\/new.hosting4agency.com\/"]}]}},"_links":{"self":[{"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/posts\/7940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/comments?post=7940"}],"version-history":[{"count":4,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/posts\/7940\/revisions"}],"predecessor-version":[{"id":8701,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/posts\/7940\/revisions\/8701"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/media\/2552"}],"wp:attachment":[{"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/media?parent=7940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/categories?post=7940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting4agency.com\/en\/wp-json\/wp\/v2\/tags?post=7940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}