{"id":416,"date":"2016-12-22T00:36:10","date_gmt":"2016-12-22T00:36:10","guid":{"rendered":"http:\/\/blog.platiniumhost.com\/?p=416"},"modified":"2016-12-22T00:36:10","modified_gmt":"2016-12-22T00:36:10","slug":"php-7-1-now-available","status":"publish","type":"post","link":"https:\/\/platiniumhost.com\/blog\/php-7-1-now-available\/","title":{"rendered":"PHP 7.1 Now Available"},"content":{"rendered":"<p><strong>PHP 7.1 Now Available on All Hosting Plans!<\/p>\n<p><\/strong><\/p>\n<p>We\u2019re happy to announce we now officially support PHP 7.1 on all our\u00a0<a href=\"https:\/\/www.platiniumhost.com\/hosting\/premium\">shared<\/a> and <u><a href=\"https:\/\/www.platiniumhost.com\/hosting\/reseller-hosting\">reseller premium<\/a><\/u> services.\u00a0 PHP 7.1 is the first point release in the 7.x series and it comes with many outstanding improvements and new features.\u00a0<img decoding=\"async\" class=\"alignright size-full wp-image-419\" src=\"http:\/\/blog.platiniumhost.com\/wp-content\/uploads\/2016\/12\/php7-transparent.png\" alt=\"\" width=\"184\" height=\"259\" srcset=\"https:\/\/platiniumhost.com\/blog\/wp-content\/uploads\/2016\/12\/php7-transparent.png 184w, https:\/\/platiniumhost.com\/blog\/wp-content\/uploads\/2016\/12\/php7-transparent-107x150.png 107w\" sizes=\"(max-width: 184px) 100vw, 184px\" \/><\/p>\n<ul>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/iterable\" target=\"_blank\" rel=\"noopener\">Iterable pseudo-type<\/a><\/li>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/class_const_visibility\" target=\"_blank\" rel=\"noopener\">Class constant visibility modifiers<\/a><\/li>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/short_list_syntax\" target=\"_blank\" rel=\"noopener\">Square bracket syntax for list()<\/a>and\u00a0<a href=\"https:\/\/wiki.php.net\/rfc\/list_keys\" target=\"_blank\" rel=\"noopener\">the ability to specify keys in list()<\/a><\/li>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/multiple-catch\" target=\"_blank\" rel=\"noopener\">Catching multiple exceptions types<\/a><\/li>\n<li><a href=\"https:\/\/wiki.php.net\/rfc#php_71\" target=\"_blank\" rel=\"noopener\">And much more<\/a><\/li>\n<\/ul>\n<p>To enable PHP 7.1 all you need to do is login to cPanel go to \u2018Select PHP Version\u2019:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-417 size-full\" src=\"http:\/\/blog.platiniumhost.com\/wp-content\/uploads\/2016\/12\/select_php_version.png\" width=\"740\" height=\"260\" srcset=\"https:\/\/platiniumhost.com\/blog\/wp-content\/uploads\/2016\/12\/select_php_version.png 740w, https:\/\/platiniumhost.com\/blog\/wp-content\/uploads\/2016\/12\/select_php_version-150x53.png 150w, https:\/\/platiniumhost.com\/blog\/wp-content\/uploads\/2016\/12\/select_php_version-300x105.png 300w, https:\/\/platiniumhost.com\/blog\/wp-content\/uploads\/2016\/12\/select_php_version-370x130.png 370w\" sizes=\"(max-width: 740px) 100vw, 740px\" \/><\/p>\n<p>From here just pick PHP 7.1 from the drop down and set it as your current PHP version.\u00a0 After this you\u2019ll be able to manage extensions as you would for any PHP version we offer and your entire account will use PHP 7.1.<\/p>\n<p>If you were curious about some of the new features and improvements here\u2019s a quick overview of them:<\/p>\n<p>Nullable Types<\/p>\n<p>In PHP 7.0 there was an introduction of types but it had one limitation you could not declare a parameter to be null without also making it optional.\u00a0 This has been resolved by utilizing the ? character. For example:<\/p>\n<p>&nbsp;<\/p>\n<table width=\"640\">\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<p>5<\/p>\n<p>6<\/p>\n<p>7<\/td>\n<td width=\"604\">function myFunction(?int $variable)<\/p>\n<p>{<\/p>\n<p>var_dump($variable);<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>myFunction(100);<\/p>\n<p>myFunction(null);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This code would return int(100) for the first and NULL for the second call to the function.<\/p>\n<p>You can also use nullable types for a return type for example:<\/p>\n<table width=\"640\">\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<p>5<\/p>\n<p>6<\/p>\n<p>7<\/p>\n<p>8<\/td>\n<td width=\"604\">function myFunction(?int $number): ?int<\/p>\n<p>{<\/p>\n<p>if ($number == null)<\/p>\n<p>{<\/p>\n<p>return null;<\/p>\n<p>}<\/p>\n<p>return $number * $number;<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Void Return Type<\/p>\n<p>You can now specify that a function cannot return a value. For example:<\/p>\n<table width=\"640\">\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/td>\n<td width=\"604\">function voidReturn(): void<\/p>\n<p>{<\/p>\n<p>return 5;<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This would now return that a void function must not return a value.<\/p>\n<p>If your website software\/application supports PHP 7.1 we suggest giving it a try. Our PHP Selector makes it easy to switch between PHP versions so you can revert back to an older version at any time. We hope you all find this to be a useful release!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP 7.1 Now Available on All Hosting Plans! We\u2019re happy to announce we now officially support PHP 7.1 on all our\u00a0shared and reseller premium services.\u00a0 PHP 7.1 is the first point release in the 7.x series and it comes with many outstanding improvements and new features.\u00a0 Iterable pseudo-type Class constant visibility modifiers Square bracket syntax&#8230;<\/p>\n","protected":false},"author":1,"featured_media":418,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/posts\/416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/comments?post=416"}],"version-history":[{"count":0,"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/posts\/416\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/media\/418"}],"wp:attachment":[{"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/media?parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/categories?post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/platiniumhost.com\/blog\/wp-json\/wp\/v2\/tags?post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}