{"id":854,"date":"2011-04-25T23:41:57","date_gmt":"2011-04-26T06:41:57","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=854"},"modified":"2011-04-25T23:41:57","modified_gmt":"2011-04-26T06:41:57","slug":"expected-changes-in-php-version-6","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2011\/04\/25\/expected-changes-in-php-version-6\/","title":{"rendered":"Expected changes in PHP version 6"},"content":{"rendered":"<p>Right now the most stable version of PHP is v5.3.6 released on march 17, 2011. PHP is powerful web language which has a big community support. The most beautiful part of PHP is that it costs you nothing to download and you will get millions of tutorials and books to learn PHP. It first appeared in 1995 and since then it has gone through a long journey with many changes. Recently I found out that PHP is releasing its version 6 in the near future, as expected it will have many changes as compared to its previous version. The most expected changes are listed below.<\/p>\n<p><a href=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/04\/php_logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-866\" title=\"PHP logo\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/04\/php_logo.png\" alt=\"\" width=\"269\" height=\"142\" \/><\/a><\/p>\n<p>Remember whatever you read here is only a prediction and not 100 % proven. We can only be sure when the actual end result , that is the final version 6 of PHP is released.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">Register Globals most likely to be removed<\/span><\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\"> <\/span>This setting in file PHP.ini is a major security problem with PHP if turned on. This setting when turned \u2018On\u2019 tells to register the contents of the GET, POST, COOKIE, SERVER and Environment variables as global variables.<\/p>\n<p>For example, <a href=\"http:\/\/www.xyz.com\/?name=joe\">http:\/\/www.xyz.com?name=joe<\/a> will set <strong>$name<\/strong> as a global variable without any coding. That\u2019s a really huge security risk and if removed in v6 will be highly praised.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">Magic Quotes will also be removed<\/span><\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\"> <\/span>The three major function magic_quotes, magic_quotes_sybase and magic_quotes_gpc \u00a0are introduced for newbies to write SQL commands without the requirement of manual escaping. This was a mistake done by inexperienced developers \u00a0more frequently and caused a lot of security issues.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">String Indexes\u00a0 { } and [ ]<\/span><\/p>\n<p>It is expected in version 6 the value of string\u2019s character at a specified position cannot be referred by using { }. In PHP 5 it generated warning messages. The only usage will be the standard array position syntax, \u00a0[ ].<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">Unicode Support in PHP<\/span><\/p>\n<p>Presently in PHP, Unicode is accessed on per request basis. It cannot be used globally \u00a0and hence it uses more resources. \u00a0It is expected that this issue would get fixed in the much awaited PHP version 6.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">var same as public<\/span><\/p>\n<p>In PHP v6 \u2018var\u2019 will be an alias of \u2018public\u2019 and will not show any warning.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">Any return by reference will generate warning<\/span><\/p>\n<p>For example function <strong>&amp;xyz <\/strong>will generate warning.<br \/>\nSimilarly <strong>$ab = &amp; new Exclass()<\/strong> will generate a warning as well.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font: bold 17px trebuchet ms,arial;\">Other possible changes<\/span><\/p>\n<p>&#8211; There will be no safe mode<br \/>\n&#8211; E_STRICT will be merged into E_ALL<br \/>\n&#8211; Ternary operator \u2018?\u2019 will work as below<br \/>\n<strong> $x = $_POST[\u2018name\u2019] ?: \u2018joe\u2019<\/strong> i.e if <strong>$x<\/strong> is true, <strong>$x <\/strong>will be equal to joe.<\/p>\n<p>&#8211; Type hinted return value<br \/>\n&#8211; foreach multidimensional array<\/p>\n<p>example- \u00a0<strong>foreach($a1 as $a2 =&gt; list($a3,$a4))<\/strong><\/p>\n<p>I hope PHP developing experience will certainly grow more interesting as soon as this version is out in the world.<br \/>\nWell I am one of those people who are eagerly waiting for the new release of PHP v6.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Right now the most stable version of PHP is v5.3.6 released on march 17, 2011. PHP is powerful web language which has a big community <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2011\/04\/25\/expected-changes-in-php-version-6\/\" title=\"Expected changes in PHP version 6\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":1090,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[30,62,108,131,200,227,256,257,262],"class_list":["post-854","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apachephp","tag-30","tag-changes","tag-expected","tag-future","tag-php","tag-sanjay","tag-trends","tag-truelogic","tag-version"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=854"}],"version-history":[{"count":0,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/854\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/1090"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}