{"id":233571,"date":"2014-08-16T21:46:03","date_gmt":"2014-08-16T17:46:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=233571"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=233571","title":{"rendered":"<span class=\"post_title\">\u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 PHP 5.6 beta 3<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/725\/ea0\/5fb\/725ea05fb24d44dd854d5fe77109a247.jpg\"\/><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a PHP \u2014 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u044f\u0437\u044b\u043a, \u0442\u043e \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0431\u0435\u0442\u0430 \u0440\u0435\u043b\u0438\u0437\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 5.6. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439: &quot;<a href=\"http:\/\/habrahabr.ru\/post\/198980\/\">\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 PHP 5.6 \u2014 \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?<\/a>&quot;.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 <b>__debugInfo()<\/b>.<\/h4>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043b\u044e\u0431\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>var_dump()<\/code>.<\/p>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0440:<\/u><\/p>\n<pre><code class=\"php\">namespace Application;  class Test {     public $prop = 200;      public function __debugInfo()     {         return [1];     } }  var_dump(new Test); <\/code><\/pre>\n<p>  <u>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/u><\/p>\n<pre><code class=\"diff\">object(Application\\Test)#2 (1) {   [0]=&gt;   int(1) } <\/code><\/pre>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/u><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>$this<\/code>, \u0442\u043e \u0432\u044b \u0432\u043e\u0439\u0434\u0435\u0442\u0435 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \ud83d\ude42<\/p>\n<h4>\u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <b>**<\/b>.<\/h4>\n<p>  \u0417\u0434\u0435\u0441\u044c, \u0443\u0432\u0435\u0440\u0435\u043d, \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0445 \u0430\u0441\u0442\u0435\u0440\u0438\u0441\u043a\u043e\u0432 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0443\u043c\u043d\u043e\u0436\u0430\u044e\u0449\u0438\u0439 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0440:<\/u><\/p>\n<pre><code class=\"php\">$exponent = 2 ** 4; var_dump($exponent); \/\/ int(16) $exponent **= 2; var_dump($exponent); \/\/ int(256)  unset($exponent);  $exponent = ~2; var_dump($exponent); \/\/ int(-3) $exponent **= 2; var_dump($exponent); \/\/ int(9) <\/code><\/pre>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/u><\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0441 GMP.<\/p>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0440:<\/u><\/p>\n<pre><code class=\"php\">$base = gmp_init(2); var_dump($base ** 3);  <\/code><\/pre>\n<p>  <u>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/u><\/p>\n<pre><code class=\"diff\">object(GMP)#3 (1) {   [&quot;num&quot;]=&gt;   string(1) &quot;8&quot; } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u042f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <b>use function<\/b> \u0438 <b>use const<\/b>.<\/h4>\n<p>  \u0418\u043c\u043f\u043e\u0440\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 (\u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d) \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0438\u043c\u043f\u043e\u0440\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u2014 \u043a\u0440\u0443\u0442\u043e. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u041a\u043e\u0433\u0434\u0430 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0434\u0435\u043b\u0430, \u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d\u043e, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0440:<\/u><\/p>\n<pre><code class=\"php\">namespace Application {     const TEST = 2 * 4;     function test()     {         return TEST;     } }  namespace {     use const Application\\TEST;     use function Application\\test;      var_dump(test(), TEST); } <\/code><\/pre>\n<p>  <u>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/u><\/p>\n<pre><code class=\"diff\">int(8) int(8) <\/code><\/pre>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u0438 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u043d\u0435\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u2014 \u043e\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u00ab\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u00bb, \u0441\u0435\u0439\u0447\u0430\u0441, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \u041e\u0442\u043d\u044b\u043d\u0435, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d, \u0442\u043e \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 <code>include<\/code> (\u0438\u043b\u0438 <code>require<\/code>) \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c <code>use function Name\\Space\\the_func<\/code>. \u0410 \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043d\u043e\u0433\u043e..?<\/p>\n<h4>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/h4>\n<p>  \u042d\u0442\u043e, \u043f\u0440\u0430\u0432\u0434\u0430, \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0435\u0449\u0435 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 5.5, \u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>  <u>\u041f\u0440\u0438\u043c\u0435\u0440:<\/u><\/p>\n<pre><code class=\"php\">spl_autoload_extensions('.php'); spl_autoload_register(); <\/code><\/pre>\n<p>  \u0420\u0430\u043d\u0435\u0435, \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u041e\u0421 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 Windows. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443? \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u2014 \u044d\u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b &quot;<b>\\<\/b>&quot;, \u0430 \u0432 win-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u044d\u0442\u043e \u0435\u0449\u0435 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0438 \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u043d\u043e\u0433\u043e \u0432 unix \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u041f\u043e \u044d\u0442\u043e\u043c\u0443-\u0442\u043e \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435:<\/p>\n<pre><code class=\"php\">spl_autoload_register(function ($class_path) {     require_once str_replace('\\\\', '\/', $class_path) . '.php'; }); <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0423\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/h4>\n<p>  \u041e\u0442\u043d\u044b\u043d\u0435, <code>input_encoding<\/code>, <code>output_encoding<\/code> \u0438 <code>internal_encoding<\/code>, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &quot;<b>UTF-8<\/b>&quot;.<\/p>\n<p>  <i>\u041e\u0431\u043e \u0432\u0441\u0435\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/wiki.php.net\/rfc#php_56\">wiki.php.net\/rfc#php_56<\/a><\/i>      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/233571\/\"> http:\/\/habrahabr.ru\/post\/233571\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/725\/ea0\/5fb\/725ea05fb24d44dd854d5fe77109a247.jpg\"\/><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a PHP \u2014 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u044f\u0437\u044b\u043a, \u0442\u043e \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0431\u0435\u0442\u0430 \u0440\u0435\u043b\u0438\u0437\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 5.6. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439: &quot;<a href=\"http:\/\/habrahabr.ru\/post\/198980\/\">\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 PHP 5.6 \u2014 \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?<\/a>&quot;.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-233571","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233571"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233571\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}