{"id":42053,"date":"2021-08-08T21:13:00","date_gmt":"2021-08-08T21:13:00","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=42053"},"modified":"2021-08-08T21:13:02","modified_gmt":"2021-08-08T21:13:02","slug":"php-definition-conflict","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/php-definition-conflict\/","title":{"rendered":"PHP: definition conflict"},"content":{"rendered":"\n<h2>Self-tutoring about &#8220;importing&#8221; artefacts in PHP: the tutor begins&#8230;<\/h2>\n<p>\nIn PHP, you can bring code from other files using, among other methods,<\/p><p><em>require_once(&#8216;a_file&#8217;)<\/em>;<\/p>\n<p>What if you end up using <em>require_once<\/em> multiple times to bring in different libraries, but two happen to contain their own definitions of a same-named artefact?<\/p>\n<p>I thought the last definition to arrive would overwrite any other, like in CSS. However, when I tried it, the program wouldn&#8217;t run at all; the server refused to serve it.<\/p>\n<p>One can imagine that two large, hastily assembled libraries by separate members of a team might end up containing their own definitions for a class of the same name. Yet, perhaps, a file that requires both those libraries mayn&#8217;t run.<\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about &#8220;importing&#8221; artefacts in PHP: the tutor begins&#8230; In PHP, you can bring code from &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/php-definition-conflict\/\"> <span class=\"screen-reader-text\">PHP: definition conflict<\/span> Read more \u2192<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2955],"tags":[],"class_list":["post-42053","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=42053"}],"version-history":[{"count":3,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42053\/revisions"}],"predecessor-version":[{"id":42056,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42053\/revisions\/42056"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=42053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=42053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=42053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}