{"id":286502,"date":"2017-05-17T19:00:08","date_gmt":"2017-05-17T15:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286502"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2017-05-17T15:00:08","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286502","title":{"rendered":"\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u0412\u0441\u0451, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440 \u0438 \u043d\u0435 \u043f\u043e\u0431\u043e\u044f\u043b\u0438\u0441\u044c \u0443\u0437\u043d\u0430\u0442\u044c"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9b9\/288\/4f0\/9b92884f0c7c49599d874f02890c19d3.jpg\" alt=\"image\" align=\"left\"\/>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0432 PHP 5, \u0434\u0430\u0432\u043d\u043e \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 \u043f\u0440\u043e\u0447\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 (\u0438\u043b\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u00ab\u043a\u043b\u0430\u0441\u0441-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439\u00bb?) \u0447\u0430\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u2014 \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430? &quot;<i>\u041a\u0430\u043a \u0431\u044b \u043a\u043b\u0430\u0441\u0441, \u043d\u043e \u0438 \u043d\u0435 \u043a\u043b\u0430\u0441\u0441, \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440, \u0441\u043a\u043e\u0440\u0435\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/i>&quot; \u2014 \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432\u044b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 \u0434\u0435\u0436\u0443\u0440\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u043d\u0430 PHP. \u041f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u044f\u0437\u044b\u043a\u0443 \u0432\u0432\u043e\u0434\u0438\u0442 \u0432\u0430\u0441 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0434\u0435 \u0442\u0430\u044f\u0442\u0441\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438\u00bb\u2026<\/p>\n<p>  \u0422\u0440\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438:  <\/p>\n<ul>\n<li><a href=\"https:\/\/habrahabr.ru\/post\/259627\/\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u00abstatic\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/habrahabr.ru\/post\/259991\/\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u043f\u0441\u0435\u0432\u0434\u043e\u0442\u0438\u043f \u00abcallable\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/habrahabr.ru\/post\/324934\/\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u0412\u0441\u0451 \u043e\u0431 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e \u043f\u0441\u0435\u0432\u0434\u043e\u0442\u0438\u043f \u00abiterable\u00bb<\/a><\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0427\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?<\/h3>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043f\u0440\u0438\u0447\u0435\u043c \u0431\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 (\u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b) \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u043e\u0439 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439:  <\/p>\n<pre><code class=\"php\">interface SomeInterface {   public function foo();   public static function bar(Baz $baz); } <\/code><\/pre>\n<p>  \u0427\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d (\u0445\u043e\u0442\u044f \u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043c\u0430\u043d\u0443\u0430\u043b\u0435) \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b (\u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435!):  <\/p>\n<pre><code class=\"php\">interface SomeInterface {   public const ERRORS = [     'OK'    =&gt; 0,     'FATAL' =&gt; 1,   ]; }  if (SomeInterface::ERRORS['OK'] === $error) {   \/\/ ... } <\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u0445\u043e\u0442\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0438\u043d\u043e\u0433\u0434\u0430? \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0445 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u0438\u043b\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u2014 \u0441\u0430\u043c\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 \u043c\u0438\u0440\u0435 \ud83d\ude42<\/p>\n<h3>\u0427\u0435\u0433\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?<\/h3>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u041a\u0440\u043e\u043c\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.<\/p>\n<p>  \u041d\u0435\u043b\u044c\u0437\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:   <\/p>\n<ul>\n<li>\u041b\u044e\u0431\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/li>\n<li>\u041d\u0435\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434\u044b \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439<\/li>\n<li>\u041d\u0435\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043e\u043d \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441!<\/p>\n<h3>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/h3>\n<p>  \u0414\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043d\u0430\u043c \u0441 \u0432\u0430\u043c\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043e\u0431\u043e\u0439\u0434\u0435\u043d\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0432 \u043c\u0430\u043d\u0443\u0430\u043b\u0435 \u043f\u043e PHP: \u043e \u043f\u043e\u043d\u044f\u0442\u0438\u0438 \u00ab\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u00bb.<\/p>\n<p>  \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u2014 \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043c\u0435\u0442\u043e\u0434\u0430), \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435 \u0432 \u0441\u0435\u0431\u044f:  <\/p>\n<ul>\n<li>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/li>\n<li>\u0418\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043c\u0435\u0442\u043e\u0434\u0430)<\/li>\n<li>\u0421\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0433\u0434\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043e:<br \/> \n<ul>\n<li>\u0422\u0438\u043f<\/li>\n<li>\u0418\u043c\u044f<\/li>\n<li>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/li>\n<li>\u043b\u0438\u0431\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u00ab\u0442\u0440\u0438 \u0442\u043e\u0447\u043a\u0438\u00bb<\/li>\n<\/ul>\n<\/li>\n<li>\u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"php\">function (); public function foo($arg = null); protected function sum(int $x, int $y, ...$args): int; <\/code><\/pre>\n<p>  \u0414\u0432\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0410 \u0438 B (\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u0430\u0436\u0435\u043d, \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e!) \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c\u0438 (B \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0439 \u0441 A) \u0432 \u0441\u0442\u0440\u043e\u0433\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0435\u0441\u043b\u0438:<\/p>\n<h4>\u041e\u043d\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442<\/h4>\n<p>  \u0422\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443\u0442 \u043d\u0435\u0447\u0435\u0433\u043e.<\/p>\n<h4>B \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a A \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/h4>\n<p>  A:  <\/p>\n<pre><code class=\"php\">function foo($x); <\/code><\/pre>\n<p>  \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 B:  <\/p>\n<pre><code class=\"php\">function foo($x, $y = null); function foo($x, ...$args); <\/code><\/pre>\n<p>  <\/p>\n<h4>B \u0441\u0443\u0436\u0430\u0435\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 A<\/h4>\n<p>  A:  <\/p>\n<pre><code class=\"php\">function foo(int $x); <\/code><\/pre>\n<p>  \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 B:  <\/p>\n<pre><code class=\"php\">\/\/ \u0412 A \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043b\u044e\u0431\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0432 B \u044d\u0442\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0441\u0443\u0436\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b function foo(int $x): int; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0432\u0435\u043b\u0438 \u044d\u0442\u0438 \u0442\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u0441\u0442\u0430\u043d\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438.<\/p>\n<h3>\u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/h3>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430:  <\/p>\n<pre><code class=\"php\">interface First {     public const PI = 3.14159;     public function foo(int $x); }  interface Second     extends First {     public const E = 2.71828;     public function bar(string $s); }  assert(3.14159 === First::PI); assert(true === method_exists(First::class, 'foo'));  assert(3.14159 === Second::PI); assert(2.71828 === Second::E); assert(true === method_exists(Second::class, 'foo')); assert(true === method_exists(Second::class, 'bar')); <\/code><\/pre>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430-\u043f\u0440\u0435\u0434\u043a\u0430 \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u043e \u0432\u0441\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0435\u0434\u043a\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<p>  \u0412 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u0435\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e, \u043b\u0438\u0431\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 (\u0441\u043c. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b):  <\/p>\n<pre><code class=\"php\">interface First {     public function foo(int $x); }  interface Second     extends First {    \/\/ \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e   public function foo(int $x);      \/\/ \u0422\u0430\u043a \u043d\u0435\u043b\u044c\u0437\u044f, \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 Declaration must be compatible   public function foo(int $x, int $y);     \/\/ \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 - \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442   public function foo(int $x, int $y = 0);        \/\/ \u0422\u0430\u043a \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e, \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0441\u043b\u0435 &quot;...&quot; \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438   public function foo(int $x, ...$args);      \/\/ \u0418 \u0442\u0430\u043a \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e   public function foo(int $x, ...$args): int;    } <\/code><\/pre>\n<h3>\u0415\u0441\u043b\u0438 \u043b\u0438 \u0432 PHP \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435?<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0437\u0430\u0434\u0430\u0434\u0443\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0441\u043c\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0439\u0442\u0435: <b>\u00ab\u0434\u0430\u00bb<\/b>. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432\u0441\u0451:  <\/p>\n<pre><code class=\"php\">interface First {     public function foo(int $x); }  interface Second {     public function bar(string $s); }  interface Third   extends First, Second {   public function baz(array $a); }  assert(true === method_exists(Third::class, 'foo')); assert(true === method_exists(Third::class, 'bar')); assert(true === method_exists(Third::class, 'baz')); <\/code><\/pre>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0432\u0438\u0434\u0435\u043b\u0438 \u0432\u044b\u0448\u0435:<br \/>   \u2014 \u043b\u0438\u0431\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e<br \/>   \u2014 \u043b\u0438\u0431\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0435\u0434\u043a\u043e\u0432 \u043f\u0435\u0440\u0432\u044b\u043c, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <br \/>  <i>(\u0434\u0430, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0434\u043a\u0438\u0439 \u043a\u0435\u0439\u0441, \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435)<\/i><\/p>\n<h3>\u0422\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/h3>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0432\u0438\u0434\u0435\u043b\u0438, \u044d\u0442\u043e \u0443\u0436\u0435 \u0438 \u043d\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a, \u043c\u0435\u043b\u043a\u0438\u0435 \u043d\u044e\u0430\u043d\u0441\u044b.<\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0421\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043d\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u044b \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430\u043c\u0438, \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0445 \u043a\u043e\u0434\u043e\u043c:  <\/p>\n<pre><code class=\"php\">interface IntSumInterface {   public function sum(int $x, int $y): int; }  interface IntMultInterface {   public function mult(int $x, int $y): int; }  class Math   implements IntSumInterface, IntMultInterface {   public function sum(int $x, int $y): int   {       return $x + $y;   }    public function mult(int $x, int $y): int   {       return $x * $y;   } } <\/code><\/pre>\n<p>  \u0412\u0430\u0436\u043d\u044b\u0439 \u0430\u0441\u043f\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043e\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u2014 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441\u0440\u0430\u0437\u0443.<\/p>\n<p>  \u041a\u0430\u043a \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441, \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 (\u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c)? \u0421\u043c\u043e\u0442\u0440\u0438 \u0432\u044b\u0448\u0435 \u2014 \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u043f\u0440\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440.<\/p>\n<p>  \u0418 \u0434\u0430. \u041d\u0435 \u0432\u0435\u0440\u044c\u0442\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u043e\u0437\u0433\u043b\u0430\u0448\u0430\u0435\u0442:  <\/p>\n<blockquote><p>\u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0434\u043e\u043b\u0436\u043d\u044b \u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.<\/p><\/blockquote>\n<p>  <\/p>\n<blockquote><p>The class implementing the interface must use the exact same method signatures as are defined in the interface. Not doing so will result in a fatal error.  <\/p><\/blockquote>\n<p>  \u0412\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"php\">interface SomeInterface {     public function sum(int $x, int $y); }  class SomeClass     implements SomeInterface {     public function sum(int $x, int $y): int     \u0438\u043b\u0438     public function sum(int $x, int $y, int $z = 0): int     \u0438\u043b\u0438 \u0434\u0430\u0436\u0435     public function sum(int $x, int $y, ...$args): int     {         \/\/ \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430     } } <\/code><\/pre>\n<h3>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441? Pro et Contra<\/h3>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043d\u0435\u0442. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0445\u043e\u0442\u044f \u0431\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u00ab\u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u00bb.<\/p>\n<p>  \u0418 \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u0434\u0430, \u0443 \u043d\u0438\u0445 \u0432 PHP \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e:  <\/p>\n<ol>\n<li>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043a\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d.<\/li>\n<li>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043a\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (\u0441 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c \u0438\u043c\u0451\u043d).<\/li>\n<li>\u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 ThisInterface<b>::class<\/b>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f<\/li>\n<li>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441, \u043c\u043e\u0436\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0440\u0430\u0432\u0430 \u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 instanceof<\/li>\n<li>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0432 \u0442\u0430\u0439\u043f-\u0445\u0438\u043d\u0442\u0438\u043d\u0433\u0435 (\u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043b\u0438\u0431\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438)<\/li>\n<\/ol>\n<h3>\u0427\u0442\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043d\u043e\u0447\u044c \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c?<\/h3>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043c\u0430\u043d\u0443\u0430\u043b \u043f\u043e \u044f\u0437\u044b\u043a\u0443:  <\/p>\n<ul>\n<li><a href=\"http:\/\/php.net\/manual\/ru\/language.oop5.interfaces.php\">php.net\/manual\/ru\/language.oop5.interfaces.php<\/a><\/li>\n<li><a href=\"http:\/\/php.net\/manual\/ru\/language.oop5.constants.php\">php.net\/manual\/ru\/language.oop5.constants.php<\/a><\/li>\n<li><a href=\"http:\/\/php.net\/manual\/ru\/language.constants.predefined.php\">php.net\/manual\/ru\/language.constants.predefined.php<\/a><\/li>\n<\/ul>\n<p>  \u041d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u043d\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043d\u043e\u0447\u044c, \u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435. <\/p>\n<p>  \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u0430\u043c\u043e\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u0435\u043d. \u0418, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0443\u0442\u0438 \u0432 IT \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u044b \u0438 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u044b. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u0430\u0436\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043f\u043e\u0441\u0435\u0449\u0430\u0442\u044c \u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u044b \u0438 \u043a\u0443\u0440\u0441\u044b \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e\u043c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0432 \u0438 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u043b\u0438\u0446\u043e! <\/p>\n<p>  \u0423\u0441\u043f\u0435\u0445\u043e\u0432 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435!<\/p>\n<p>  N.B.: \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 <b>\u2193<\/b><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/328890\/\"> https:\/\/habrahabr.ru\/post\/328890\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9b9\/288\/4f0\/9b92884f0c7c49599d874f02890c19d3.jpg\" alt=\"image\" align=\"left\"\/>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0432 PHP 5, \u0434\u0430\u0432\u043d\u043e \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 \u043f\u0440\u043e\u0447\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 (\u0438\u043b\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u00ab\u043a\u043b\u0430\u0441\u0441-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439\u00bb?) \u0447\u0430\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u2014 \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430? &quot;<i>\u041a\u0430\u043a \u0431\u044b \u043a\u043b\u0430\u0441\u0441, \u043d\u043e \u0438 \u043d\u0435 \u043a\u043b\u0430\u0441\u0441, \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440, \u0441\u043a\u043e\u0440\u0435\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/i>&quot; \u2014 \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432\u044b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 \u0434\u0435\u0436\u0443\u0440\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u043d\u0430 PHP. \u041f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u044f\u0437\u044b\u043a\u0443 \u0432\u0432\u043e\u0434\u0438\u0442 \u0432\u0430\u0441 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0434\u0435 \u0442\u0430\u044f\u0442\u0441\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438\u00bb\u2026<\/p>\n<p>  \u0422\u0440\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438:  <\/p>\n<ul>\n<li><a href=\"https:\/\/habrahabr.ru\/post\/259627\/\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u00abstatic\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/habrahabr.ru\/post\/259991\/\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u043f\u0441\u0435\u0432\u0434\u043e\u0442\u0438\u043f \u00abcallable\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/habrahabr.ru\/post\/324934\/\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e PHP: \u0412\u0441\u0451 \u043e\u0431 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e \u043f\u0441\u0435\u0432\u0434\u043e\u0442\u0438\u043f \u00abiterable\u00bb<\/a><\/li>\n<\/ul>\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-286502","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286502","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=286502"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286502\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}