{"id":618,"date":"2020-05-23T12:11:10","date_gmt":"2020-05-23T09:11:10","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=618"},"modified":"2020-05-23T12:11:10","modified_gmt":"2020-05-23T09:11:10","slug":"klasy","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/klasy\/","title":{"rendered":"\u041a\u043b\u0430\u0441\u0438"},"content":{"rendered":"<p>\u041a\u043b\u0430\u0441 \u0454 \u043e\u0434\u043d\u0438\u043c \u0437 \u0442\u0438\u043f\u0456\u0432 \u0434\u0430\u043d\u0438\u0445. \u041a\u043e\u0436\u043d\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043a\u043b\u0430\u0441\u0443 \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u0442\u044c\u0441\u044f \u0437 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 class, \u043f\u043e\u0442\u0456\u043c \u0441\u043b\u0456\u0434 \u0456\u043c&#8217;\u044f \u043a\u043b\u0430\u0441\u0443, \u043f\u0430\u0440\u0430 \u0444\u0456\u0433\u0443\u0440\u043d\u0438\u0445 \u0434\u0443\u0436\u043e\u043a, \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u044f\u043a\u0438\u0445 \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u0437\u043d\u0430\u0447\u0430\u0442\u0438 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456 \u0456 \u043c\u0435\u0442\u043e\u0434\u0438 (\u0431\u0443\u0434\u0435 \u0440\u043e\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u043e) \u0446\u044c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0443.<\/p>\n<p>\u0406\u043c\u0435\u043d\u0435\u043c \u043a\u043b\u0430\u0441\u0443 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0443\u0434\u044c-\u044f\u043a\u0435 \u0441\u043b\u043e\u0432\u043e, \u0437\u0430 \u0443\u043c\u043e\u0432\u0438, \u0449\u043e \u0432\u043e\u043d\u043e \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u043e\u0432\u0430\u043d\u0438\u0445 \u0441\u043b\u0456\u0432 PHP, \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u0442\u044c\u0441\u044f \u0437 \u043b\u0456\u0442\u0435\u0440\u0438 \u0430\u0431\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0443 \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u043d\u044f \u0456 \u0437\u0430 \u044f\u043a\u0438\u043c \u0441\u043b\u0456\u0434\u0443\u0454 \u0431\u0443\u0434\u044c-\u044f\u043a\u0430 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0431\u0443\u043a\u0432, \u0446\u0438\u0444\u0440 \u0430\u0431\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0456\u0432 \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u043d\u044f.<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\nclass FirstClass\r\n{\r\n\u00a0 \u00a0 \u00a0...\r\n}\r\n?&gt;<\/pre>\n<h3>\u041e\u0431&#8217;\u0454\u043a\u0442\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 (\u043e\u0431&#8217;\u0454\u043a\u0442\u0430) \u043a\u043b\u0430\u0441\u0443 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>new<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u043a\u043b\u0430\u0434 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043e\u0431&#8217;\u0454\u043a\u0442\u0430:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$instance = new FirstClass();\r\n\r\n\/\/ \u0426\u0435 \u043c\u043e\u0436\u043d\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0456 \u0437 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0437\u043c\u0456\u043d\u043d\u043e\u0457\r\n$className = 'FirstClass';\r\n$instance = new $className(); \/\/ FirstClass()\r\n?&gt;<\/pre>\n<h3>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0438 \\ \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0438<\/h3>\n<p>PHP \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0454 \u043e\u0433\u043e\u043b\u043e\u0448\u0443\u0432\u0430\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0438 &#8211; \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0438. \u041a\u043b\u0430\u0441\u0438, \u0432 \u044f\u043a\u0438\u0445 \u043e\u0433\u043e\u043b\u043e\u0448\u0435\u043d\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 &#8211; \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438 \u0446\u0435\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438 \u043a\u043e\u0436\u043d\u043e\u043c\u0443 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u0456 \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0431&#8217;\u0454\u043a\u0442\u0430.<\/p>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:<\/p>\n<pre class=\"prettyprint linenums\">function __construct(mixed $args = \"\") { \/\/ \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\r\n\u00a0 \u00a0 \u00a0...\r\n}<\/pre>\n<p>\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\nclass FirstClass\r\n{\r\n\u00a0 \u00a0 \u00a0function __construct($hello = \"hi\") {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return $hello;\r\n\u00a0 \u00a0 \u00a0}\r\n}\r\n\r\n$instance = new FirstClass(); \/\/ \u043f\u043e\u0432\u0435\u0440\u043d\u0435 \u0440\u044f\u0434\u043e\u043a \"hi\"\r\n$instance = new FirstClass(\"hello\"); \/\/ \u043f\u043e\u0432\u0435\u0440\u043d\u0435 \u0440\u044f\u0434\u043e\u043a \"hello\"\r\n?&gt;<\/pre>\n<p>\u0422\u0430\u043a\u043e\u0436, \u0432 PHP \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0456 <strong>\u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0438<\/strong>. \u0414\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0443\u0434\u0435 \u0432\u0438\u043a\u043b\u0438\u043a\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u0437\u0432\u0456\u043b\u044c\u043d\u0435\u043d\u043d\u0456 \u0432\u0441\u0456\u0445 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c \u043d\u0430 \u043f\u0435\u0432\u043d\u0438\u0439 \u043e\u0431&#8217;\u0454\u043a\u0442 \u0430\u0431\u043e \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u0456 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0456\u0432 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0443\u0454\u0442\u044c\u0441\u044f).<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\nclass FirstClass\r\n{\r\n\u00a0 \u00a0 \u00a0function __destruct() {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 echo \"\u0412\u0438\u043a\u043b\u0438\u043a \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\";\r\n\u00a0 \u00a0 \u00a0}\r\n}\r\n?&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043b\u0430\u0441 \u0454 \u043e\u0434\u043d\u0438\u043c \u0437 \u0442\u0438\u043f\u0456\u0432 \u0434\u0430\u043d\u0438\u0445. \u041a\u043e\u0436\u043d\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043a\u043b\u0430\u0441\u0443 \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u0442\u044c\u0441\u044f \u0437 \u043a\u043b\u044e\u0447\u043e\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 class, \u043f\u043e\u0442\u0456\u043c \u0441\u043b\u0456\u0434 \u0456\u043c&#8217;\u044f \u043a\u043b\u0430\u0441\u0443, \u043f\u0430\u0440\u0430 \u0444\u0456\u0433\u0443\u0440\u043d\u0438\u0445 \u0434\u0443\u0436\u043e\u043a, \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u044f\u043a\u0438\u0445 \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u0437\u043d\u0430\u0447\u0430\u0442\u0438 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456 \u0456 \u043c\u0435\u0442\u043e\u0434\u0438 (\u0431\u0443\u0434\u0435 \u0440\u043e\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u043e) \u0446\u044c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0443. \u0406\u043c\u0435\u043d\u0435\u043c \u043a\u043b\u0430\u0441\u0443 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0443\u0434\u044c-\u044f\u043a\u0435 \u0441\u043b\u043e\u0432\u043e, \u0437\u0430 \u0443\u043c\u043e\u0432\u0438, \u0449\u043e \u0432\u043e\u043d\u043e \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u043e\u0432\u0430\u043d\u0438\u0445 \u0441\u043b\u0456\u0432 PHP, \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u0442\u044c\u0441\u044f \u0437 \u043b\u0456\u0442\u0435\u0440\u0438 \u0430\u0431\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0443 \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u043d\u044f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-618","post","type-post","status-publish","format-standard","hentry","category-oop"],"_links":{"self":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/comments?post=618"}],"version-history":[{"count":1,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/618\/revisions"}],"predecessor-version":[{"id":619,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/618\/revisions\/619"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}