{"id":216651,"date":"2014-03-22T23:05:03","date_gmt":"2014-03-22T19:05:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=216651"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=216651","title":{"rendered":"<span class=\"post_title\">JPHP \u2014 \u041d\u043e\u0432\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a php \u0434\u043b\u044f Java VM + JIT<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u043c \u0441\u0432\u043e\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 <b>JPHP<\/b>. \u042d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f PHP \u0434\u043b\u044f JavaVM \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 JIT. \u042f \u043d\u0430\u0447\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0443 \u0432 \u043e\u043a\u0442\u044f\u0431\u0440\u0435 2013 \u0433\u043e\u0434\u0430 \u0438 \u0437\u0430 4 \u043c\u0435\u0441\u044f\u0446\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 php \u0432 \u0431\u0430\u0439\u0442\u043a\u043e\u0434 JVM. \u042f\u0437\u044b\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 PHP 5.3, \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 PHP 5.4 \u0438 5.5. \u041f\u043e \u0441\u0432\u043e\u0435\u0439 \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 JRuby \u0438 Jython. <\/p>\n<p>  \u042f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043d\u0435 \u043e\u0442\u043d\u0438\u043c\u0435\u0442 \u0443 \u0432\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438:<\/p>\n<div class=\"slideshow\"><iframe loading=\"lazy\" src=\"http:\/\/www.slideshare.net\/slideshow\/embed_code\/32580244\" width=\"425\" height=\"355\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<blockquote><p>\u0415\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u0431\u043e\u044e\u0441\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0435 \u0443\u043c\u0435\u0441\u0442\u0438\u0442\u044c. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0443\u043c\u0431\u0443\u0440\u043d\u043e.<\/p><\/blockquote>\n<ul>\n<li>\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f: Apache License 2.0<\/li>\n<li>\u0410\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/dim-s\/jphp\">https:\/\/github.com\/dim-s\/jphp<\/a><\/li>\n<li>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c: JavaVM 1.6+ (Linux, Windows, MacOS, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0435\u0437\u0434\u0435 \u0433\u0434\u0435 \u0435\u0441\u0442\u044c Java).<\/li>\n<\/ul>\n<h4>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h4>\n<p>  JPHP \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0430 \u0434\u043b\u044f Zend PHP \u0438\u043b\u0438 Facebook HHVM, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u043b\u0430\u043d\u0430\u0445 \u043d\u0435 \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 runtime \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a zend php, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a CURL, PRCE, PDO \u0438 \u0442.\u043f. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b, \u043f\u043e\u0431\u0443\u0434\u0438\u0432\u0448\u0438\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\u042d\u0442\u043e \u0431\u044b\u043b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 java \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 PHP<\/li>\n<li>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u0441\u0447\u0435\u0442 JIT + JVM<\/li>\n<li>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u0443\u0440\u043e\u0434\u043b\u0438\u0432\u044b\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c Zend PHP \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0435<\/li>\n<li>\u041f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 PHP \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 Web<\/li>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u044e\u043d\u0438\u043a\u043e\u0434\u0430 \u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438<\/li>\n<\/ul>\n<h4>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0438<\/h4>\n<p>  \u0412\u0435\u0441\u044c \u044f\u0437\u044b\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Java \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"http:\/\/asm.ow2.org\/\">ASM<\/a> \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0430\u0439\u0442\u043a\u043e\u0434\u0430, \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u0441\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 jvm \u044f\u0437\u044b\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Groovy. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d Gradle.<\/p>\n<p>  \u041a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e, \u0441\u0442\u0435\u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 Java \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f jvm \u044f\u0437\u044b\u043a\u0430. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e VM \u0441 JIT, \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u043d\u0435 \u0431\u043e\u043b\u0438\u0442 \u0433\u043e\u043b\u043e\u0432\u0430 \u043e \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0430 \u0441\u0430\u043c \u0431\u0430\u0439\u0442\u043a\u043e\u0434 jvm \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043e\u043a \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u0435\u0439, \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0437-\u0437\u0430 \u043c\u0430\u0433\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 php.<\/p>\n<p>  JIT \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 1-10 \u0440\u0430\u0437, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432, \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0432 1.5-3 \u0440\u0430\u0437\u0430 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u042f \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0435\u0449\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. <\/p>\n<h4>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 PHP?<\/h4>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a \u043d\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u043e\u0432 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438. \u0423\u0436\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u0434\u043e\u043b\u0436\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 PHP \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u044c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435, \u0445\u043e\u0442\u044f \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u0435\u0449\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a spl autoloading, Reflection, ob_* \u0444\u0443\u043d\u043a\u0446\u0438\u0438, <code>&lt;? ... ?&gt;<\/code> \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. <\/p>\n<p>  JPHP \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043e\u043a\u043e\u043b\u043e 300+ \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432 \u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e Zend PHP, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u041e\u041e\u041f, \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0442.\u043f. \u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0438 \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c, \u0447\u0442\u043e \u044f\u0437\u044b\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0414\u0430\u043b\u0435\u0435 \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0438\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\u042f\u0437\u044b\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 PHP 5.3 (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c goto)<\/li>\n<li>Typehinting \u0434\u043b\u044f callable (5.4)<\/li>\n<li>\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 (5.4)<\/li>\n<li><code>Class::{expr}(), (new Foo)-&gt;bar()<\/code> (5.4)<\/li>\n<li>try\u2026 finally (5.5)<\/li>\n<li>Array and string literal dereferencing (5.5)<\/li>\n<li>Function array dereferencing foo()[0] (5.4)<\/li>\n<li>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 <code>class<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 (5.5)<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0439\u0442\u043e\u0432 \u0438\u0437 php 5.4.<\/p>\n<h4>JIT \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c? \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 Facebook HHVM, \u0442\u043e \u0434\u0443\u043c\u0430\u044e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a\u043e\u0439. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 PHP \u044d\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043c\u0430\u0433\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0433\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 JPHP \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0422\u0430\u043c, \u0433\u0434\u0435 \u043d\u0435\u0442 \u043c\u0430\u0433\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043a \u043d\u0438\u043c \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"php\">$var = 'foobar'; $x = 'var'; ${$x} = 'chanched'; \/\/ \u043c\u0430\u0433\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">$global_var = 100500; include 'file.php'; \/\/ \u043c\u0430\u0433\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0432 include \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c global scope \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">function foobar() {    $x = 100500;    $var = get_defined_vars(); \/\/ \u043e\u043f\u044f\u0442\u044c \u043c\u0430\u0433\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 } <\/code><\/pre>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, JPHP \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u043c\u0435\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0430 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442 \u2014 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c.<\/p>\n<p>  \u041c\u0430\u0433\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 2 \u0440\u0430\u0437\u0430 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0432 JPHP. \u0412 Zend PHP \u043a\u043e\u0434 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445. <\/p>\n<h4>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440<\/h4>\n<p>  \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 JPHP \u0443\u043c\u0435\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u0432\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u0447\u0435\u043a \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  <b>1. \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/b>  <\/p>\n<pre><code class=\"php\">$x = (20 + 30) . 'foobar';  \/\/ \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 1 \u0440\u0430\u0437 <\/code><\/pre>\n<p>  <b>2. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b<\/b><br \/>  \u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 JPHP \u0437\u043d\u0430\u0435\u0442 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0435\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 <code>define<\/code>. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <code>__FILE__, __DIR__, __CLASS__<\/code>, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b java \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0447\u0435\u0440\u0435\u0437 <code>const<\/code>. \u0412\u0441\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"php\">include __DIR__ . '\/core.php'; \/\/ \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 <\/code><\/pre>\n<p>  <b>3. Immutable \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b<\/b><br \/>  \u042d\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439, \u0438\u043b\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043e\u043d\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e.<\/p>\n<pre><code class=\"php\">for ($i = 0; $i &lt; 100500; $i++){     $x = cos(1) + 3; \/\/ \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f 1 \u0440\u0430\u0437 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u043d\u0435 100500 } <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f cos() \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u0438 immutable, \u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 cos(1) \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u041a immutable \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u044b, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0412\u044b\u0437\u043e\u0432 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 JPHP \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"php\">function getVersion(){     return '1.0'; }  $x = getVersion(); \/\/ \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u044b\u0437\u043e\u0432  define('VERSION', '1.0'); $x = VERSION; \/\/ \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b = \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <\/code><\/pre>\n<p>  <b>4. \u041d\u0435\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/b><br \/>  \u0415\u0441\u043b\u0438 \u0432 if \u0438\u043b\u0438 elseif \u0443 \u0432\u0430\u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442 \u043b\u0438\u0448\u043d\u0435\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441\u043e\u0432\u0441\u0435\u043c. \u041f\u043e\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c if, else \u0438 elseif. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c:<\/p>\n<pre><code class=\"php\">if (TRACE_ENABLED){ \/\/ \u0435\u0441\u043b\u0438 TRACE_ENABLED = false, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043c\u0435\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434      log(&quot;Log text...&quot;); } <\/code><\/pre>\n<h4>\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0431\u0430\u0439\u0442\u043a\u043e\u0434\u0430?<\/h4>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b JPHP \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442.\u0435. \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041e\u0434\u0438\u043d \u0440\u0430\u0437 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e. \u0412 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0438\u0441\u0430\u0442\u044c http \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0443\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 Phalcon \u043d\u0430 \u0441\u0430\u043c\u043e\u043c PHP. \u0414\u0430\u043d\u043d\u044b\u0435 \u043b\u0435\u0433\u043a\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0430 http \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c php, \u043e \u0447\u0435\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435.<\/p>\n<p>  \u0412 JPHP \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <b>Environment<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u044d\u0442\u043e \u0447\u0435\u043c-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 sandbox \u0438\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f runkit. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<ul>\n<li>Environment \u2014 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/li>\n<li>\u041f\u043e\u0434\u043e\u0431\u0435\u043d sandbox \u0438\u0437 runkit<\/li>\n<li>\u041d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0433\u0438\u0431\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438<\/li>\n<li>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c HOT reload \u0441\u0445\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u044b<\/li>\n<li>\u041e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435, \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e http \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<h4>\u041a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c? \u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442?<\/h4>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Java (1.6+) \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 Gradle. \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438\u0437 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. JetBrains IDEA \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 build.gradle. \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0435\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 <code>jphp-example-project<\/code>. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 jar \u0444\u0430\u0439\u043b, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 php. \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 jar \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f <code>bootstrap.php<\/code> \u0444\u0430\u0439\u043b. \u0421\u043e\u0431\u0440\u0430\u0442\u044c jar \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">gradle jar <\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437:<\/p>\n<pre><code class=\"bash\">gradle exampleStart <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 <code>build\/libs\/<\/code> \u0432 jar \u0444\u0430\u0439\u043b.<\/p>\n<h4>GUI? \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b?<\/h4>\n<p>  \u042f \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435-\u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0434\u043b\u044f Swing (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Java \u0434\u043b\u044f GUI). \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 GUI \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0441\u043e Swing, \u0445\u043e\u0447\u0443 \u043e\u0431\u043d\u0430\u0434\u0435\u0436\u0438\u0442\u044c \u2014 \u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b \u0430\u043f\u0438 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 layouts. \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u043a\u043e\u0448\u043a\u043e \u043d\u0430 GUI:<\/p>\n<pre><code class=\"php\">    use php\\lang\\System;     use php\\swing\\SwingUtilities;     use php\\swing\\UIForm;     use php\\swing\\UIDialog;     use php\\swing\\UIButton;      SwingUtilities::invokeLater(function(){         $form = new UIForm();         $form-&gt;size = [500, 500];         $form-&gt;moveToCenter();         $form-&gt;visible = true;          $p = new UIButton();         $p-&gt;size = [300, 40];         $p-&gt;align = 'top';         $p-&gt;h = 30;         $p-&gt;text = '\u041a\u043d\u043e\u043f\u043a\u0430';         $p-&gt;on('click', function(){               UIDialog::message('\u041f\u0440\u0438\u043c\u0435\u0442', '\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a');         });         $form-&gt;add($p);          $form-&gt;on('windowClosing', function(){             System::halt(0);         });     }); <\/code><\/pre>\n<h4>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 HTTP \u0441\u0435\u0440\u0432\u0435\u0440?<\/h4>\n<p>  \u041d\u0430 JPHP \u043c\u043e\u0436\u043d\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 http \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043b\u0430\u0441\u0441\u044b <code>Socket <\/code> \u0438 <code>ServerSokect<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0442\u043e\u043a\u043e\u0432 <code>Thread<\/code>.<\/p>\n<pre><code class=\"php\">    use php\\concurrent\\ExecutorService;     use php\\io\\IOException;     use php\\lang\\Environment;     use php\\net\\ServerSocket;      $server = new ServerSocket();     $server-&gt;bind('localhost', 8080);     $service = ExecutorService::newFixedThreadPool(5); \/\/ create a thread pool      echo &quot;Start HTTP Server on http:\/\/localhost:8080\/ ...\\n&quot;;      while (true) {         $socket = $server-&gt;accept();         echo &quot;Connect client ... \\n&quot;;          $service-&gt;execute(function() use ($socket) { \/\/ processing a http request in a thread             ob_implicit_flush(true);              $out = $socket-&gt;getOutput();             try {                 $out-&gt;write(&quot;HTTP\/1.1 200 OK\\r\\n&quot;);                 $out-&gt;write(&quot;Content-Type: text\/html\\r\\n&quot;);                 $out-&gt;write(&quot;Connection: close\\r\\n\\r\\n&quot;);                  $out-&gt;write(&quot;Hello world!&quot;);                 $out-&gt;flush();             } catch (IOException $e) {                 echo &quot;Error: &quot; . $e-&gt;getMessage(), &quot;\\n&quot;;             } finally { \/\/ JPHP supports `finally` as in PHP 5.5                 $socket-&gt;shutdownOutput();             }          }, new Environment());     } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442, \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0447\u0435\u0440\u0435\u0437 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 ab \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0442. \u041d\u0430 \u043c\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 (Java 7, i3, Windows 7) \u0442\u0430\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c 4000-5000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (<code>ab -n50000 -c100 http:\/\/localhost\/<\/code>) \u0438 \u043d\u0435 \u043f\u0430\u0434\u0430\u0442\u044c.<\/p>\n<h4>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h4>\n<p>  \u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c JPHP, \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0434\u043e \u0440\u0435\u043b\u0438\u0437\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e PHP 5.5. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 Android (\u043f\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0443 Roboto \u0434\u043b\u044f JRuby). \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 namespaces \u0438 \u041e\u041e\u041f, \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u044f \u043a\u043e\u0435 \u0447\u0442\u043e \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u2014 \u043f\u043e\u0442\u043e\u043a\u0438, \u0441\u043e\u043a\u0435\u0442\u044b, gui, json.<\/p>\n<blockquote><p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p><\/blockquote>\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\/216651\/\"> http:\/\/habrahabr.ru\/post\/216651\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u043c \u0441\u0432\u043e\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 <b>JPHP<\/b>. \u042d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f PHP \u0434\u043b\u044f JavaVM \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 JIT. \u042f \u043d\u0430\u0447\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0443 \u0432 \u043e\u043a\u0442\u044f\u0431\u0440\u0435 2013 \u0433\u043e\u0434\u0430 \u0438 \u0437\u0430 4 \u043c\u0435\u0441\u044f\u0446\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 php \u0432 \u0431\u0430\u0439\u0442\u043a\u043e\u0434 JVM. \u042f\u0437\u044b\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 PHP 5.3, \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 PHP 5.4 \u0438 5.5. \u041f\u043e \u0441\u0432\u043e\u0435\u0439 \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 JRuby \u0438 Jython. <\/p>\n<p>  \u042f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043d\u0435 \u043e\u0442\u043d\u0438\u043c\u0435\u0442 \u0443 \u0432\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438:<\/p>\n<div class=\"slideshow\"><iframe loading=\"lazy\" src=\"http:\/\/www.slideshare.net\/slideshow\/embed_code\/32580244\" width=\"425\" height=\"355\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<p>  <\/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-216651","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/216651","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=216651"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/216651\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=216651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=216651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=216651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}