{"id":179441,"date":"2013-05-14T23:27:03","date_gmt":"2013-05-14T19:27:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=179441"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=179441","title":{"rendered":"<span class=\"post_title\">\u0425\u0430\u043a \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 PHP<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u0412\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u044f\u0434\u0440\u043e PHP? \u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441? \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 C, \u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e. \u0414\u0430, \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e \u2014 \u0437\u0430\u0431\u0430\u0432\u043d\u043e \u0432\u0435\u0434\u044c.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0439 \u0432 PHP, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"php\">&lt;?php class ClassName {} <\/code><\/pre>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code class=\"php\">&lt;?php class ClassName; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0442\u043e \u043e\u043d, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. \u041d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"bash\">$ sudo apt-get install bison re2c <\/code><\/pre>\n<p>  PHP \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0430\u0440\u0441\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Bison. Bison \u2014 \u044d\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0435\u0433\u043e, \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u0432 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e-\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0443\u044e \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0443 \u0432 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 LR \u0438\u043b\u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 LR (GLR) \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b LALR-\u043f\u0430\u0440\u0441\u0435\u0440\u0430 (Look-Ahead LR parser \u2014 \u043f\u0440\u0438\u043c. \u043f\u0435\u0440.).<\/p>\n<p>  \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0446\u0435\u043b\u0443\u044e \u043a\u043d\u0438\u0433\u0443. \u0415\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u044f \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b \u0431\u044b \u0432\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"http:\/\/www.gnu.org\/software\/bison\/manual\/bison.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a>. \u041e\u043d\u0430 \u043d\u0435 \u0438\u0437 \u043b\u0435\u0433\u043a\u0438\u0445, \u0437\u0430\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u043e\u0439.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <a href=\"http:\/\/php.net\">http:\/\/php.net<\/a> \u0438 \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0441\u0432\u0435\u0436\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 PHP.<\/p>\n<pre><code class=\"bash\">$ tar xvjf php-5.4.14.tar.bz2 $ cd php-5.4.14 $ .\/configure $ cd Zend $ ls <\/code><\/pre>\n<p>  \u0421\u043d\u0438\u043c\u0438\u0442\u0435 \u0448\u043b\u044f\u043f\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0432\u0430\u043c\u0438 \u044f\u0434\u0440\u043e PHP. \u041a\u043e\u0434 \u0432 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0435\u0433\u043e.<\/p>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 Bison \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u00aby\u00bb.<\/p>\n<pre><code class=\"bash\">$ ls *.y zend_ini_parser.y zend_language_parser.y <\/code><\/pre>\n<p>  \u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u00abini\u00bb, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u00abzend_language_parser.y\u00bb. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0432\u0430\u0448\u0438\u043c \u043b\u044e\u0431\u0438\u043c\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u043e \u00abclass\u00bb, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">%token T_CLASS      &quot;class (T_CLASS)&quot; <\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0441\u0435\u0440 \u043b\u044e\u0431\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438. \u0422\u043e\u043a\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430 \u2014 \u044d\u0442\u043e &quot;<b>T_CLASS<\/b>&quot;. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0438\u0449\u0435\u0442\u0435 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 &quot;<b>T_CLASS<\/b>&quot;, \u0442\u043e \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435:<\/p>\n<pre><code class=\"cpp\">class_entry_type:     T_CLASS { $$.u.op.opline_num = CG(zend_lineno); $$.EA = 0; }     | T_ABSTRACT T_CLASS { $$.u.op.opline_num = CG(zend_lineno); $$.EA = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }     | T_TRAIT { $$.u.op.opline_num = CG(zend_lineno); $$.EA = ZEND_ACC_TRAIT; }     | T_FINAL T_CLASS { $$.u.op.opline_num = CG(zend_lineno); $$.EA = ZEND_ACC_FINAL_CLASS; }     ; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0432\u0430\u043c\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430.  <\/p>\n<ol>\n<li>\u043a\u043b\u0430\u0441\u0441 (class)<\/li>\n<li>\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 (abstract class)<\/li>\n<li>\u0442\u0440\u0435\u0439\u0442 (trait)<\/li>\n<li>\u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 (\u043b\u0438\u0441\u0442\u043e\u0432\u043e\u0439, \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439) \u043a\u043b\u0430\u0441\u0441 (final class)<\/li>\n<\/ol>\n<p>  \u0412 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0439 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u042f \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0442\u0440\u043e\u0433\u0430\u0442\u044c.<\/p>\n<p>  \u041c\u044b \u043d\u0430 \u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0443\u0442\u0438, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0438\u0449\u0435\u043c. \u041f\u043e\u0438\u0449\u0438\u0442\u0435 \u0444\u0440\u0430\u0437\u0443 \u00abclass_entry_type\u00bb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0442\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u041e\u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u0432\u0430\u0441 \u043a \u043f\u0443\u043d\u043a\u0442\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043b\u0435\u0433\u043a\u043e, \u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0432\u0430\u0442\u043e.<\/p>\n<pre><code class=\"cpp\">unticked_class_declaration_statement:       class_entry_type T_STRING extends_from             { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); }             implements_list             '{'             class_statement_list             '}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }       | interface_entry T_STRING             { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }            interface_extends_list            '{'           class_statement_list            '}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }     ; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u0435. \u041e\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 &quot;<b>class_entry_type<\/b>&quot;, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438: class | abstract class | trait | final class. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u0442\u043e\u043a\u0435\u043d <b>T_STRING<\/b>. \u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043d\u0430 \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430. &quot;<b>extends_from<\/b>&quot; \u2014 \u044d\u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430. \u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 \u00abextends T_STRING\u00bb \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0441\u0435\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u043e\u043a Zend, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<pre><code class=\"cpp\">{ zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); } <\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 <i>zend_compiler.c<\/i>.<\/p>\n<pre><code class=\"cpp\">void zend_do_begin_class_declaration(const znode *class_token, znode *class_name, const znode *parent_class_name TSRMLS_DC) <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0437\u0434\u0435\u0441\u044c \u2014 \u044d\u0442\u043e \u0442\u043e\u043a\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430 &quot;<b>class_entry_type<\/b>&quot;, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 &quot;<b>T_STRING<\/b>&quot;, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u2014 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 &quot;<b>extends_from<\/b>&quot;.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u0438\u0434\u0451\u0442 \u0433\u0440\u0443\u043f\u043f\u0430 \u00abimplements_list\u00bb. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430. \u0412\u0435\u0440\u043d\u043e, \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0435\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u0430: \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u043d\u0430\u044f \u0441\u043a\u043e\u0431\u043a\u0430 &quot;<b>{<\/b>&quot;, \u0433\u0440\u0443\u043f\u043f\u0430 &quot;<b>class_statement_list<\/b>&quot; \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u043d\u0430\u044f \u0441\u043a\u043e\u0431\u043a\u0430 &quot;<b>}<\/b>&quot;. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0430\u0440\u0441\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u043a\u0443 Zend, \u0447\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e.<\/p>\n<pre><code class=\"cpp\">{ zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); } <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u043d\u043e \u0443\u0436\u0435 \u0431\u0435\u0437 \u0442\u0435\u043b\u0430 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<pre><code class=\"cpp\">unticked_class_declaration_statement:       class_entry_type T_STRING extends_from             { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); }             ';' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }       | class_entry_type T_STRING extends_from               { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); }             implements_list             '{'             class_statement_list             '}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }       | interface_entry T_STRING             { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }            interface_extends_list            '{'           class_statement_list            '}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }     ; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\">$ cd .. $ make <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<pre><code class=\"bash\">$ vim test.php <\/code><\/pre>\n<p>  \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u0434 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"php\">&lt;?php class FooBar;  $a = new FooBar; $a-&gt;bar = 10;  print_r($a); <\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e.<\/p>\n<pre><code class=\"bash\">$ sapi\/cli\/php test.php  FooBar Object ( [bar] =&gt; 10 ) <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0443 \u0432\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c!<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0449\u0435 \u043a\u043e\u0435-\u0447\u0442\u043e. \u0412 PHP \u0432\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0435 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 &quot;<b>class<\/b>&quot;. \u041a\u0430\u043a \u043d\u0430\u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043a\u043e\u0440\u043e\u0447\u0435? \u0414\u0443\u043c\u0430\u044e, &quot;<b>cls<\/b>&quot;, \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442.<\/p>\n<p>  \u0418\u0449\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u043b\u0435\u043a\u0441\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">$ cd Zend\/ $ ls *.l zend_ini_scanner.l zend_language_scanner.l <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b Bison \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438. \u041b\u0435\u043a\u0441\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0442\u043e\u043a\u0435\u043d\u044b. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 zend_language_scanner.l \u0438 \u043f\u043e\u0438\u0449\u0438\u0442\u0435 \u0441\u043b\u043e\u0432\u043e &quot;<b>class<\/b>&quot;.<\/p>\n<pre><code class=\"cpp\">&lt;ST_IN_SCRIPTING&gt;&quot;class&quot; { return T_CLASS; } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 class \u043d\u0430 cls.<\/p>\n<pre><code class=\"cpp\">&lt;ST_IN_SCRIPTING&gt;&quot;cls&quot; { return T_CLASS; }  &lt;ST_IN_SCRIPTING&gt;&quot;class&quot; { return T_CLASS; } <\/code><\/pre>\n<p>  \u0414\u0435\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e. \u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043e\u0434 \u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e &quot;<b>cls<\/b>&quot; \u0432\u043c\u0435\u0441\u0442\u043e &quot;<b>class<\/b>&quot;.<\/p>\n<p>  \u041d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438 \u0437\u0430\u0431\u0430\u0432\u043d\u043e? \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u043c\u043d\u0435. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0439\u0442\u0435\u0441\u044c, \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435. \u0418 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 <a href=\"https:\/\/bugs.php.net\/\">https:\/\/bugs.php.net\/<\/a>.        \t\t   \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\/179441\/\"> http:\/\/habrahabr.ru\/post\/179441\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u0412\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u044f\u0434\u0440\u043e PHP? \u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441? \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 C, \u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e. \u0414\u0430, \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e \u2014 \u0437\u0430\u0431\u0430\u0432\u043d\u043e \u0432\u0435\u0434\u044c.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0439 \u0432 PHP, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"php\">&lt;?php class ClassName {} <\/code><\/pre>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code class=\"php\">&lt;?php class ClassName; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0442\u043e \u043e\u043d, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. \u041d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.  <\/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-179441","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/179441","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=179441"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/179441\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=179441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=179441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=179441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}