{"id":3300,"date":"2022-12-16T17:47:42","date_gmt":"2022-12-16T12:17:42","guid":{"rendered":"https:\/\/devtechnosys.ae\/blog\/?p=3300"},"modified":"2023-05-18T10:40:33","modified_gmt":"2023-05-18T05:10:33","slug":"php-8-2","status":"publish","type":"post","link":"https:\/\/devtechnosys.ae\/blog\/php-8-2\/","title":{"rendered":"PHP 8.2 All You Need To Know Features &#038; Changes"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">PHP is an open-source programming language used for server-side scripting of website apps. It was initially named the Personal Home Page. It provides large frameworks for common operations to save the time necessary for writing software. PHP swiftly gained popularity due to its user-friendly features and wide range of abilities, so over 75% of sites utilize it for control and guidance.<\/span><\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#What_is_PHP_82\" >What is PHP 8.2?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#i\" >\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#PHP_82_New_Features\" >PHP 8.2 New Features\u00a0<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#1_Read-only_Classes\" >1. Read-only Classes\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#2_Disjunctive_Normal_Font_Types\" >2. Disjunctive Normal Font Types\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#3_Redact_Sensitive_Parameters_in_Back_Traces\" >3. Redact Sensitive Parameters in Back Traces<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#4_Constants_in_Trait\" >4. Constants in Trait\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#5_New_mysqli_execute_query_Function_and_mysqli_execute_query_Method\" >5. New mysqli_execute_query Function and mysqli::execute_query Method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#6_Allow_True_False_and_Null_as_Standalone_Types\" >6. Allow True, False, and Null as Standalone Types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#7_Allow_Dynamic_Properties_Attribute\" >7. Allow Dynamic Properties Attribute<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#Deprecated_Features_PHP_82\" >Deprecated Features PHP 8.2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#Some_Major_Changes_in_PHP_82\" >Some Major Changes in PHP 8.2\u00a0<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/devtechnosys.ae\/blog\/php-8-2\/#Takeaway\" >Takeaway\u00a0<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p><span style=\"font-weight: 400;\">One of PHP&#8217;s key benefits is that it frequently obtains upgrades that repair issues and continually adds new functionality. Due to this, programmers worldwide patiently await the newest updates to strengthen and enhance their web forms. The <\/span><b><a href=\"https:\/\/www.php.net\/releases\/8.2\/en.php\" target=\"_blank\" rel=\"no-follow noopener\">PHP 8.2 release date<\/a><\/b><span style=\"font-weight: 400;\"> was in December 2022.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Thus, in this blog, we will discuss the latest version of<\/span> <span style=\"font-weight: 400;\">PHP 8.2 including all the major features and necessary changes.\u00a0<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_is_PHP_82\"><\/span><b>What is PHP 8.2?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"i\"><\/span><b>\u00a0<\/b><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3301 aligncenter\" src=\"https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2022\/12\/PHP-8.2.jpg\" alt=\"PHP 8.2\" width=\"750\" height=\"394\" srcset=\"https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2022\/12\/PHP-8.2.jpg 750w, https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2022\/12\/PHP-8.2-300x158.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Version 8.2 of PHP, which was released in December 2022, improved the development process, added some new functionality, and corrected errors from earlier iterations.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The procedure also managed to get rid of earlier, less-used obsolete functionality. You must update your web app to the latest edition of PHP if it is built on an earlier version. It would surely enhance the functionality and protection of your app.\u00a0<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"PHP_82_New_Features\"><\/span><b>PHP 8.2 New Features\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Here are the essential features of PHP 8.2. So let&#8217;s have a look at the essential features.\u00a0<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Read-only_Classes\"><\/span><span style=\"font-size: 18.72px;\">1. <strong>Read-only<\/strong><\/span><strong> Classes<\/strong><span style=\"font-weight: 400;\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Read-only classes introduced in PHP 8.2 go beyond read-only attributes. A class&#8217;s variables are effectively made read-only when that class is made read-only. Additionally, it assures that all variables are defined and stops dynamic behavior from being added to read-only classes. The readonly User class dynamically declares each of its attributes to be read-only.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Disjunctive_Normal_Font_Types\"><\/span><b>2. Disjunctive Normal Font Types\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The DNF method, which involves placing disjunctions between connectives, is used to structure Boolean formulas. In this, we may combine the Unions and Collision types using the type description that was written in the DNF.<br \/>\n<b><\/b><\/p>\n<p><span style=\"font-weight: 400;\">The parser can read it.\u00a0 In PHP 8.2, the fonts can become more effective by the novel DNF types functionality in PHP 8.2. The variable description, return type, and input statement is all included in this DNF.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Redact_Sensitive_Parameters_in_Back_Traces\"><\/span><b>3. Redact Sensitive Parameters in Back Traces<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In every codebase, reporting production faults to the services is standard procedure. Programmers would be notified if something problem occurs. Additionally, it entails transmitting stack data to the third-party service across the network.<br \/>\n<b><\/b><\/p>\n<p><span style=\"font-weight: 400;\">It includes names, variables, and some confidential material like a password. You are allowed to annotate these vulnerable arguments in PHP 8.2. When any problem occurs, it stops the stack traces from displaying the error.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Constants_in_Trait\"><\/span><b>4. Constants in Trait<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Constants can now be declared in attributes thanks to <\/span><b>PHP 8.2<\/b><span style=\"font-weight: 400;\">. The traits cannot be easily reached, but if a class uses a trait, those constants become class constants. PHP 8.1 and before did not permit this. It is impossible to retrieve trait constants immediately. Additionally, the trait constants should not contradict any additional traits or the local class in which they are used.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_New_mysqli_execute_query_Function_and_mysqli_execute_query_Method\"><\/span><b>5. New mysqli_execute_query Function and mysqli::execute_query Method<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A simpler method for managing customized MySQLi queries is introduced in PHP 8.2. You can create, bind, and research confirms in the same code using the mysqli execute query function and the mysqli\u2013execute query procedure. When a query has been performed effectively, you will receive the mysqli result property.<br \/>\n<b><\/b><\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_Allow_True_False_and_Null_as_Standalone_Types\"><\/span><b>6. Allow True, False, and Null as Standalone Types<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Scalar types such as string, int, and bool are already present in PHP. It became extended in PHP 8.0 with the introduction of type systems. It permits variables to be of various sorts. False and null were not permitted as standalone types, whereas the same RFC permitted their use as union types. If you specify false, null, or a freestanding type, the result will be a critical error.<br \/>\n<b><\/b><\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_Allow_Dynamic_Properties_Attribute\"><\/span><b>7. Allow Dynamic Properties Attribute<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>With the introduction of the new #AllowDynamicProperties property in PHP 8.2, it is now possible to use deformations without receiving a deprecation warning. It is a universal domain declaration that accepts no parameters. Taking help from an experienced <b><a href=\"https:\/\/devtechnosys.ae\/php-development\">PHP development company<\/a> <\/b>to improve your PHP to the latest version would be a better choice.<br \/>\n<b><\/b><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Deprecated_Features_PHP_82\"><\/span><b>Deprecated Features PHP 8.2<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Here are some of the deprecated features of PHP 8.2 that you must check.\u00a0\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">#utf8_encode() and utf8_decode() Functions<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Mbstring: Base64, Uuencode, QPrint, and HTML Entity Encodings<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Partially-Supported Callables<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">${var} String Interpolation<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Some_Major_Changes_in_PHP_82\"><\/span><b>Some Major Changes in PHP 8.2\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li aria-level=\"1\">Random extension improvement<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">MySQLi no longer supports libmysql<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Sort order changes for the ksort functions\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The str_split Function Returns Empty Arrays for Empty Strings<\/span><\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"Takeaway\"><\/span><b>Takeaway\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Like any other well-liked web framework, PHP may cause some problems for users while creating applications. However, it is frequently updated with the latest PHP 8.2 version. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">This version streamlines the app&#8217;s development cycle while introducing additional capabilities to enhance the application&#8217;s usefulness and protection. Therefore, if you lack programming knowledge or expertise, you must seek the assistance of professional Programmers to improve your PHP to the latest edition. <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP is an open-source programming language used for server-side scripting of website apps. It was initially named the Personal Home Page. It provides large frameworks for common operations to save the time necessary for writing software. PHP swiftly gained popularity due to its user-friendly features and wide range of abilities, so over 75% of sites utilize it for control and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":3302,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[321,31],"tags":[505,506,242,508,507],"class_list":["post-3300","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","category-php-development","tag-php-8-2","tag-php-8-2-relese","tag-website-development-services","tag-website-development-services-dubai","tag-wordpress-website"],"acf":[],"_links":{"self":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts\/3300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/comments?post=3300"}],"version-history":[{"count":6,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts\/3300\/revisions"}],"predecessor-version":[{"id":5063,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts\/3300\/revisions\/5063"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/media\/3302"}],"wp:attachment":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/media?parent=3300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/categories?post=3300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/tags?post=3300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}