{"id":27037,"date":"2016-12-02T01:02:29","date_gmt":"2016-12-01T23:02:29","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=27037"},"modified":"2016-12-02T01:02:29","modified_gmt":"2016-12-01T23:02:29","slug":"migrating-to-php-7","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2016\/12\/02\/migrating-to-php-7\/","title":{"rendered":"Migrating to PHP 7"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p><a href=\"http:\/\/php.net\/releases\/7_0_0.php\">PHP 7.0.0<\/a> has been released for <a href=\"https:\/\/secure.php.net\/releases\/\">a year now<\/a>. \u00a0I wasn&#8217;t in a rush to migrate to it, but with all the cool features and performance optimization, it&#8217;s definitely something I wanted to look into rather sooner than later.<\/p>\n<p>It turns out that I&#8217;ve done my first PHP 7 migration a week ago, when I <a href=\"https:\/\/mamchenkov.net\/wordpress\/2016\/11\/24\/fedora-25\/\">upgraded my laptop\u00a0to Fedora 25<\/a>. \u00a0Yup, that&#8217;s right. \u00a0It&#8217;s a bit embarrassing, but I have been developing on PHP 7 for a week without even noticing it.<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\n$ php --version\r\nPHP 7.0.13 (cli) (built: Nov 9 2016 07:29:28) ( NTS )\r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies\r\nwith Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans\r\n<\/pre>\n<p>I think that was due to a few things:<\/p>\n<ul>\n<li>It&#8217;s been quite a busy week, so my attention was all over the place.<\/li>\n<li>PHP 7 backward compatibility is pretty awesome. \u00a0There are only a few things that need fixing in the older code bases, but if you haven&#8217;t been living under a rock for the last few years, you probably have nothing to change or worry about.<\/li>\n<li>Most of the code I&#8217;m working on runs through TravisCI builds, which are executed on both PHP 5.6 and PHP 7. \u00a0Since we had this for a while now, most, if not all, of our code is PHP 7 compatible.<\/li>\n<\/ul>\n<p>The absolute lack of any issues for the last week, related to this upgrade, is encouraging. \u00a0Now I will probably try to upgrade our servers sooner than later.<\/p>\n<p>With that, I&#8217;ll go back to the wonderful and exciting world of PHP, leaving you to decide whether I&#8217;m very serious or very sarcastic&#8230;<\/p>\n<p>&nbsp;<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>PHP 7.0.0 has been released for a year now. \u00a0I wasn&#8217;t in a rush to migrate to it, but with all the cool features and performance optimization, it&#8217;s definitely something I wanted to look into rather sooner than later. It turns out that I&#8217;ve done my first PHP 7 migration a week ago, when I &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2016\/12\/02\/migrating-to-php-7\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Migrating to PHP 7<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Migrating to PHP 7 #PHP #WebDev #Fedora #Linux","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,6,18,62,1334],"tags":[2351,38,1330],"keyring_services":[],"class_list":["post-27037","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-programming","category-technology","category-web-work","tag-fedora-linux","tag-php","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":24821,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/10\/07\/rogue-wave-software-acquires-zend-technologies\/","url_meta":{"origin":27037,"position":0},"title":"Rogue Wave Software acquires Zend Technologies","author":"Leonid Mamchenkov","date":"October 7, 2015","format":false,"excerpt":"Zend Technologies, the company behind PHP, has been acquired by Rogue Wave Software. \u00a0This sounds like huge news, except that I have no idea about who Rogue Wave Software are, what they do, and what's their plan in regards to PHP. \u00a0Sure, the announcement suggests that they'll help to push\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"zend rogue wave","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2015\/10\/zend-rogue-wave-500x287.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":24398,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/06\/23\/php7-reference\/","url_meta":{"origin":27037,"position":1},"title":"PHP7 Reference","author":"Leonid Mamchenkov","date":"June 23, 2015","format":"link","excerpt":"PHP7 Reference -\u00a0An overview of the features, changes, and backward compatibility breakages in PHP 7 Unarguably the greatest part about PHP 7 is the incredible performance boosts it provides to applications. This is a result of refactoring the Zend Engine to use more compact data structures and less heap allocations\/deallocations.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11395,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/10\/25\/oracle-and-php-the-deadly-mix\/","url_meta":{"origin":27037,"position":2},"title":"Oracle and PHP &#8211; the deadly mix","author":"Leonid Mamchenkov","date":"October 25, 2008","format":false,"excerpt":"WI've spent most of the last week getting into, around, and out of the issues related to interoperability of Oracle and PHP.\u00a0 Before you start laughing, cursing, and blaming, Oracle wasn't my choice of the database for this specific project.\u00a0 It's just the company already had it installed and working\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":15018,"url":"https:\/\/mamchenkov.net\/wordpress\/2011\/06\/03\/pagoda-box-scalable-platform-for-your-php-application\/","url_meta":{"origin":27037,"position":3},"title":"Pagoda Box &#8211; scalable platform for your PHP application","author":"Leonid Mamchenkov","date":"June 3, 2011","format":false,"excerpt":"I got my hands on a private beta of Pagoda Box. \u00a0It is a platform that you can deploy your PHP applications to. \u00a0 I gave it a brief look around and I have to say it's pretty sweet. Right after you register and get access to your dashboard, you\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2011\/06\/pagodabox-500x313.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":25030,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/12\/10\/weird-php-error-output-bug\/","url_meta":{"origin":27037,"position":4},"title":"Weird PHP error output bug","author":"Leonid Mamchenkov","date":"December 10, 2015","format":false,"excerpt":"We came across this PHP bug at work today. \u00a0But before you go and read it, let me show you a use case. \u00a0See, if you can spot the problem. We had a cron job script which looked something like this (shortened for clarity): [code lang=\"bash\"] #!\/bin\/bash # ... a\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27042,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/12\/02\/php-7-1-0-released\/","url_meta":{"origin":27037,"position":5},"title":"PHP 7.1.0 Released!","author":"Leonid Mamchenkov","date":"December 2, 2016","format":false,"excerpt":"PHP 7.1.0 release is out, bringing quite a bit of new features and improvements. \u00a0Here are some of the new things: Nullable types Void return type Iterable pseudo-type Class constant visiblity modifiers Square bracket syntax for list() and the ability to specify keys in list() Catching multiple exceptions types Many\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/27037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=27037"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/27037\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=27037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=27037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=27037"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=27037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}