{"id":3638,"date":"2021-02-12T09:22:56","date_gmt":"2021-02-12T09:22:56","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=3638"},"modified":"2022-02-17T07:13:47","modified_gmt":"2022-02-17T07:13:47","slug":"namespace-general","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/namespace\/namespace-general","title":{"rendered":".Namespace general"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Define namespace for a file<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\r\nnamespace MyNamespaceName;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">This files namespace<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>define(__NAMESPACE__ . \"\\MY_DEFINE_NAME_VALUE\",                                   1234);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Calling a function in a namespace \/ a different namespace<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>$Number = \\MyNamespaceName\\MyFunctionName();<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Define namespace for a file This files namespace Calling a function in a namespace \/ a different namespace<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[297],"tags":[],"class_list":["post-3638","post","type-post","status-publish","format-standard","hentry","category-namespace"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=3638"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3638\/revisions"}],"predecessor-version":[{"id":3639,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3638\/revisions\/3639"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=3638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=3638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=3638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}