{"id":31094,"date":"2020-12-21T16:35:37","date_gmt":"2020-12-21T21:35:37","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=31094"},"modified":"2020-12-21T16:35:37","modified_gmt":"2020-12-21T21:35:37","slug":"php-8","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/12\/21\/php-8\/","title":{"rendered":"PHP 8"},"content":{"rendered":"<p><a href=\"https:\/\/www.php.net\/archive\/2020.php#2020-11-26-3\">The PHP Group<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=25220674\">Hacker News<\/a>, <a href=\"https:\/\/developers.slashdot.org\/story\/20\/11\/28\/1030246\/php-80-brings-major-and-breaking-changes-to-a-25-year-old-language\">Slashdot<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.php.net\/archive\/2020.php#2020-11-26-3\"><p>PHP 8.0 comes with numerous improvements and new features such as:<\/p><ul><li>Union Types<\/li><li>Named Arguments<\/li><li>Match Expressions<\/li><li>Attributes<\/li><li>Constructor Property Promotion<\/li><li>Nullsafe Operator<\/li><li>Weak Maps<\/li><li>Just In Time Compilation<\/li><li>And much much more&#8230;<\/li><\/ul><p>Take a look at the <a href=\"https:\/\/www.php.net\/releases\/8.0\/\">PHP 8.0 Announcement Addendum<\/a> for more information.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/developer.yoast.com\/blog\/the-2020-wordpress-and-php-8-compatibility-report\/\">Omar Reiss<\/a>:<\/p>\n<blockquote cite=\"https:\/\/developer.yoast.com\/blog\/the-2020-wordpress-and-php-8-compatibility-report\/\">\n<p>In the first part of this report we&rsquo;ll outline the changes in PHP 8 that are likely to significantly impact WordPress and other legacy codebases. In the second part of this report, we&rsquo;ll try to provide a perspective on past, present and future challenges regarding WordPress and PHP compatibility.<\/p>\n<p>[&#8230;]<\/p>\n<p>One of the most important breaking changes in PHP 8 has to do with strict typing. User-defined functions in PHP already throw a TypeError. However, internal functions emitted warnings and returned null. PHP 8 makes this consistent and internal functions now also throw a TypeError. This will not only impact functions that already threw warnings prior to PHP 8, but also magic methods (which previously weren&rsquo;t type checked) and functions that have had type declarations introduced. For this reason, it&rsquo;s not possible to catch all issues that arise from this change by fixing the type warnings in PHP 7.4 environments.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>The PHP Group (Hacker News, Slashdot): PHP 8.0 comes with numerous improvements and new features such as:Union TypesNamed ArgumentsMatch ExpressionsAttributesConstructor Property PromotionNullsafe OperatorWeak MapsJust In Time CompilationAnd much much more&#8230;Take a look at the PHP 8.0 Announcement Addendum for more information. Omar Reiss: In the first part of this report we&rsquo;ll outline the changes in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-12-21T21:35:39Z","apple_news_api_id":"04d3d30a-1044-4484-8c41-0008f9453c3b","apple_news_api_modified_at":"2020-12-21T21:35:40Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/ABNPTChBERISMQQAI-UU8Ow","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[46,359,71,740],"class_list":["post-31094","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-php","tag-programming","tag-wordpress"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=31094"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31094\/revisions"}],"predecessor-version":[{"id":31095,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31094\/revisions\/31095"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=31094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=31094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=31094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}