{"id":618,"date":"2021-03-23T08:29:18","date_gmt":"2021-03-23T08:29:18","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=618"},"modified":"2025-04-09T02:47:05","modified_gmt":"2025-04-09T02:47:05","slug":"php-access-modifiers","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-oop\/php-access-modifiers\/","title":{"rendered":"PHP Access Modifiers"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn about PHP access modifiers, including public and private, and understand the differences between them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-php-access-modifiers'>Introduction to PHP access modifiers <a href=\"#introduction-to-php-access-modifiers\" class=\"anchor\" id=\"introduction-to-php-access-modifiers\" title=\"Anchor for Introduction to PHP access modifiers\">#<\/a><\/h2>\n\n\n\n<p><a href=\"https:\/\/phptutorial.net\/php-oop\/php-objects\/\">In the objects and classes tutorial<\/a>, you have learned about how to use the <code>public<\/code> access modifier with properties and methods.<\/p>\n\n\n\n<p>PHP has three access modifiers: <code>public<\/code>, <code>private<\/code>, and <code>protected<\/code>. In this tutorial, you&#8217;ll focus on the <code>public<\/code> and <code>private<\/code> access modifiers.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>public<\/code> access modifier allows you to access properties and methods from both inside and outside of the class.<\/li>\n\n\n\n<li>The <code>private<\/code> access modifier prevents you from accessing properties and methods from the outside of the class.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='the-public-access-modifier'>The public access modifier <a href=\"#the-public-access-modifier\" class=\"anchor\" id=\"the-public-access-modifier\" title=\"Anchor for The public access modifier\">#<\/a><\/h2>\n\n\n\n<p>When you place the <code>public<\/code> keyword in front of a property or a method, the property or method becomes public. It means that you can access the property and method from both inside and outside of the class.<\/p>\n\n\n\n<p>The following example illustrates the <code>public<\/code> access modifier:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Customer<\/span>\n<\/span>{\n\t<span class=\"hljs-keyword\">public<\/span> $name;\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getName<\/span><span class=\"hljs-params\">()<\/span>\n\t<\/span>{\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;name;\n\t}\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmNsYXNzIEN1c3RvbWVyCnsKCXB1YmxpYyAkbmFtZTsKCglwdWJsaWMgZnVuY3Rpb24gZ2V0TmFtZSgpCgl7CgkJcmV0dXJuICR0aGlzLT5uYW1lOwoJfQp9\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this example, the <code>Customer<\/code> class has a <code>public<\/code> property (<code>$name<\/code>) and <code>public<\/code> method (<code>getName()<\/code>). And you can access the property and method from both inside and outside of the class. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Customer<\/span>\n<\/span>{\n\t<span class=\"hljs-keyword\">public<\/span> $name;\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getName<\/span><span class=\"hljs-params\">()<\/span>\n\t<\/span>{\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;name;\n\t}\n}\n\n$customer = <span class=\"hljs-keyword\">new<\/span> Customer();\n$customer-&gt;name = <span class=\"hljs-string\">'Bob'<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> $customer-&gt;getName(); <span class=\"hljs-comment\">\/\/ Bob<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmNsYXNzIEN1c3RvbWVyCnsKCXB1YmxpYyAkbmFtZTsKCglwdWJsaWMgZnVuY3Rpb24gZ2V0TmFtZSgpCgl7CgkJcmV0dXJuICR0aGlzLT5uYW1lOwoJfQp9CgokY3VzdG9tZXIgPSBuZXcgQ3VzdG9tZXIoKTsKJGN1c3RvbWVyLT5uYW1lID0gJ0JvYic7CmVjaG8gJGN1c3RvbWVyLT5nZXROYW1lKCk7IC8vIEJvYg\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>How it works.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, create a new instance of the <code>Customer<\/code> class.<\/li>\n\n\n\n<li>Second, set the value of the <code>$name<\/code> property to <code>'Bob'<\/code>.<\/li>\n\n\n\n<li>Third, call the <code>getName()<\/code> method of the <code>$customer<\/code> object and display the name.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='the-private-access-modifier'>The private access modifier <a href=\"#the-private-access-modifier\" class=\"anchor\" id=\"the-private-access-modifier\" title=\"Anchor for The private access modifier\">#<\/a><\/h2>\n\n\n\n<p>To prevent access to properties and methods from <em>outside <\/em>of the class, you use the <code>private<\/code> access modifier. <\/p>\n\n\n\n<p>The following example changes <code>$name<\/code> property of the <code>Customer<\/code> class from <code>public<\/code> to <code>private<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Customer<\/span>\n<\/span>{\n\t<span class=\"hljs-keyword\">private<\/span> $name;\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getName<\/span><span class=\"hljs-params\">()<\/span>\n\t<\/span>{\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;name;\n\t}\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCgpjbGFzcyBDdXN0b21lcgp7Cglwcml2YXRlICRuYW1lOwoKCXB1YmxpYyBmdW5jdGlvbiBnZXROYW1lKCkKCXsKCQlyZXR1cm4gJHRoaXMtPm5hbWU7Cgl9Cn0\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>If you attempt to access the <code>$name<\/code> property from the outside of the class, you&#8217;ll get an error. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">$customer = <span class=\"hljs-keyword\">new<\/span> Customer();\n$customer-&gt;name = <span class=\"hljs-string\">'Bob'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">Fatal error: Uncaught Error: Cannot access <span class=\"hljs-keyword\">private<\/span> property Customer::$name<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>So how do you access a <code>private<\/code> property?<\/p>\n\n\n\n<p>To manipulate the value of a private property, you need to define a public method and use the method to manage a private property. <\/p>\n\n\n\n<p>Typically, you need to define two kinds of public methods to manage a private property:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A getter returns the value of the private property.<\/li>\n\n\n\n<li>A setter sets a new value for the private property.<\/li>\n<\/ul>\n\n\n\n<p>By convention, the getter and setter have the following name:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">getPropertyName\nsetPropertyName<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following <code>Customer<\/code> class defines the getter (<code>getName<\/code>) and setter(<code>setName)<\/code> to get and set the value of the <code>$name<\/code> property:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Customer<\/span>\n<\/span>{\n\t<span class=\"hljs-keyword\">private<\/span> $name;\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">setName<\/span><span class=\"hljs-params\">($name)<\/span>\n\t<\/span>{\n\t\t<span class=\"hljs-keyword\">$this<\/span>-&gt;name = $name;\n\t}\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getName<\/span><span class=\"hljs-params\">()<\/span>\n\t<\/span>{\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;name;\n\t}\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>And the following shows how to use the <code>setName()<\/code> and <code>getName()<\/code> methods to set and get the value of the <code>$name<\/code> property:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">$customer = <span class=\"hljs-keyword\">new<\/span> Customer();\n\n$customer-&gt;setName(<span class=\"hljs-string\">'Bob'<\/span>);\n<span class=\"hljs-keyword\">echo<\/span> $customer-&gt;getName();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCgpjbGFzcyBDdXN0b21lcgp7Cglwcml2YXRlICRuYW1lOwoKCXB1YmxpYyBmdW5jdGlvbiBzZXROYW1lKCRuYW1lKQoJewoJCSR0aGlzLT5uYW1lID0gJG5hbWU7Cgl9CgoJcHVibGljIGZ1bmN0aW9uIGdldE5hbWUoKQoJewoJCXJldHVybiAkdGhpcy0-bmFtZTsKCX0KfQoKJGN1c3RvbWVyID0gbmV3IEN1c3RvbWVyKCk7CgokY3VzdG9tZXItPnNldE5hbWUoJ0JvYicpOwplY2hvICRjdXN0b21lci0-Z2V0TmFtZSgpOw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='why-do-you-need-private-property'>Why do you need private property? <a href=\"#why-do-you-need-private-property\" class=\"anchor\" id=\"why-do-you-need-private-property\" title=\"Anchor for Why do you need private property?\">#<\/a><\/h2>\n\n\n\n<p>It may be faster to use the <code>public<\/code> access modifier for properties instead of using a private property with the public getter\/setter.<\/p>\n\n\n\n<p>However, by using the <code>private<\/code> property, you can prevent direct access to the property from the outside of the class. <\/p>\n\n\n\n<p>In addition, the getter\/setter methods ensure that the only way to access the property is through these methods. And the getter\/setter methods can provide custom logic to manipulate the property value.<\/p>\n\n\n\n<p>For example, if you want the value of the <code>$name<\/code> property to be not blank, you can add the validation logic to the <code>setName()<\/code> method as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Customer<\/span>\n<\/span>{\n\t<span class=\"hljs-keyword\">private<\/span> $name;\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">setName<\/span><span class=\"hljs-params\">($name)<\/span>\n\t<\/span>{\n\t\t$name = trim($name);\n\n\t\t<span class=\"hljs-keyword\">if<\/span> ($name == <span class=\"hljs-string\">''<\/span>) {\n\t\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">false<\/span>;\n\t\t}\n\t\t<span class=\"hljs-keyword\">$this<\/span>-&gt;name = $name;\n\n                <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">true<\/span>;\n\n\t}\n\n\t<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getName<\/span><span class=\"hljs-params\">()<\/span>\n\t<\/span>{\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;name;\n\t}\n}\n\n$customer = <span class=\"hljs-keyword\">new<\/span> Customer();\n\n$customer-&gt;setName(<span class=\"hljs-string\">' Bob '<\/span>);\n<span class=\"hljs-keyword\">echo<\/span> $customer-&gt;getName();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmNsYXNzIEN1c3RvbWVyCnsKCXByaXZhdGUgJG5hbWU7CgoJcHVibGljIGZ1bmN0aW9uIHNldE5hbWUoJG5hbWUpCgl7CgkJJG5hbWUgPSB0cmltKCRuYW1lKTsKCgkJaWYgKCRuYW1lID09ICcnKSB7CgkJCXJldHVybiBmYWxzZTsKCQl9CgkJJHRoaXMtPm5hbWUgPSAkbmFtZTsKCiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKCgl9CgoJcHVibGljIGZ1bmN0aW9uIGdldE5hbWUoKQoJewoJCXJldHVybiAkdGhpcy0-bmFtZTsKCX0KfQoKJGN1c3RvbWVyID0gbmV3IEN1c3RvbWVyKCk7CgokY3VzdG9tZXItPnNldE5hbWUoJyBCb2IgJyk7CmVjaG8gJGN1c3RvbWVyLT5nZXROYW1lKCk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In the <code>setName()<\/code> method:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, remove all leading and trailing whitespace using the <code><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-ltrim\/\">trim()<\/a><\/code> function.<\/li>\n\n\n\n<li>Second, return false if the <code>$name<\/code> argument is blank. Otherwise, assign it to the <code>$name<\/code> property and return <code>true<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>public<\/code> access modifier to allow access to properties and methods from both inside and outside of the class.<\/li>\n\n\n\n<li>Use the <code>private<\/code> access modifier to prevent access from the outside of the class.<\/li>\n\n\n\n<li>Do use <code>private<\/code> properties with a pair of public getter\/setter methods.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Did you find this tutorial useful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"618\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-oop\/php-access-modifiers\/\"\n\t\t\t\tdata-post-title=\"PHP Access Modifiers\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"618\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-oop\/php-access-modifiers\/\"\n\t\t\t\tdata-post-title=\"PHP Access Modifiers\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn about PHP access modifiers including public and private, and understand the differences between them.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1753,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-618","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/comments?post=618"}],"version-history":[{"count":5,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/618\/revisions"}],"predecessor-version":[{"id":3330,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/618\/revisions\/3330"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1753"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}