{"id":202709,"date":"2025-06-25T17:05:19","date_gmt":"2025-06-25T17:05:19","guid":{"rendered":"https:\/\/www.softwaretestinghelp.com\/?page_id=202709"},"modified":"2025-07-04T12:47:57","modified_gmt":"2025-07-04T12:47:57","slug":"php-operators","status":"publish","type":"page","link":"https:\/\/www.softwaretestinghelp.com\/php\/php-operators\/","title":{"rendered":"PHP Operators: Classification With Examples"},"content":{"rendered":"\n<p><strong>PHP Operators are the special symbols or strings for operations on PHP variables &amp; values. Discover the different categories of PHP Operators with simple programming code examples:<\/strong><\/p>\n\n\n\n<p>In this tutorial, you will learn about PHP operators (like PHP assignment operators, PHP comparison operators, PHP ternary operators, and many more), the precedence of operators, and frequently asked questions (FAQs).<\/p>\n\n\n\n<p>Please note that we have used PHP version 7 in all examples.<\/p>\n\n\n\n<p>Let\u2019s begin!<\/p>\n\n\n\n<p><strong>=&gt; <a href=\"https:\/\/www.softwaretestinghelp.com\/php\/\">Complete PHP Guide for ALL<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding PHP Operators<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2021\/12\/PHP-Operators.png\"><img decoding=\"async\" width=\"700\" height=\"394\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2021\/12\/PHP-Operators.png\" alt=\"PHP Operators\" class=\"wp-image-203095\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2021\/12\/PHP-Operators.png 700w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2021\/12\/PHP-Operators-300x169.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/figure>\n\n\n\n<p><strong>What is an Operator<\/strong><\/p>\n\n\n\n<p>In simple words, an operator is a symbol that is used to operate on operands. When you consider the example, <strong>5 + 10<\/strong>, <strong>5<\/strong> &amp; <strong>10<\/strong> are the operands, and <strong>+<\/strong> is the operator.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Classification of PHP Operators<\/h2>\n\n\n\n<p><strong>There are 11 categories of operators in PHP. They are:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Arithmetic<\/li>\n\n\n\n<li>Assignment<\/li>\n\n\n\n<li>Comparison<\/li>\n\n\n\n<li>Incrementing and decrementing<\/li>\n\n\n\n<li>Bitwise<\/li>\n\n\n\n<li>Logical<\/li>\n\n\n\n<li>String<\/li>\n\n\n\n<li>Array<\/li>\n\n\n\n<li>Type<\/li>\n\n\n\n<li>Execution<\/li>\n\n\n\n<li>Error Control<\/li>\n<\/ol>\n\n\n\n<p>Apart from the above classification, we can also classify operators based on operands as shown in the list below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP Unary Operators &#8211; It works on a single operand. <strong>Example<\/strong>: ++, &#8212;<\/li>\n\n\n\n<li>PHP Binary Operators &#8211; It works on two operands. <strong>Example<\/strong>: +, &#8211;<\/li>\n\n\n\n<li>PHP Ternary Operators &#8211; It works on three operands. <strong>Example<\/strong>: ?:<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">#1) Arithmetic Operator<\/h3>\n\n\n\n<p>An arithmetic operator is used to perform common arithmetic operations like addition, multiplication, etc.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3541-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3541\" class=\"tablepress tablepress-id-3541 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">+<\/td><td class=\"column-3\">Addition<\/td><td class=\"column-4\">$c + $d<\/td><td class=\"column-5\">Sum of $c and $d<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">&#8211;<\/td><td class=\"column-3\">Subtraction<\/td><td class=\"column-4\">$c &#8211; $d<\/td><td class=\"column-5\">Difference of $c and $d<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">*<\/td><td class=\"column-3\">Multiplication<\/td><td class=\"column-4\">$c * $d<\/td><td class=\"column-5\">Product of $c and $d<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">\/<\/td><td class=\"column-3\">Division<\/td><td class=\"column-4\">$c \/ $d<\/td><td class=\"column-5\">Quotient of $c and $d<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">%<\/td><td class=\"column-3\">Modulo<\/td><td class=\"column-4\">$c % $d<\/td><td class=\"column-5\">Remainder of $c divided by $d<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">**<\/td><td class=\"column-3\">Exponentiation<\/td><td class=\"column-4\">$c ** $d<\/td><td class=\"column-5\">Result of raising $c to the $d&#8217;th power<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">7<\/td><td class=\"column-2\">+<\/td><td class=\"column-3\">Identity<\/td><td class=\"column-4\">+$c<\/td><td class=\"column-5\">Conversion of $c to int or float as appropriate<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">8<\/td><td class=\"column-2\">&#8211;<\/td><td class=\"column-3\">Negation<\/td><td class=\"column-4\">-$c<\/td><td class=\"column-5\">Opposite of $c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3541 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = 2;  \n$d = 4;\n\necho $c + $d.&quot;&lt;br&gt;&quot;; \/\/outputs: 6\necho $c - $d.&quot;&lt;br&gt;&quot;; \/\/outputs: -2\necho $c * $d.&quot;&lt;br&gt;&quot;;  \/\/outputs: 8\necho $c \/ $d.&quot;&lt;br&gt;&quot;;  \/\/outputs: 0.5\necho $c % $d.&quot;&lt;br&gt;&quot;;  \/\/outputs: 2\necho $c ** $d.&quot;&lt;br&gt;&quot;;  \/\/outputs: 16\necho +$c.&quot;&lt;br&gt;&quot;; \/\/outputs: 2\necho -$c;  \/\/outputs: -2 \n?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#2) Assignment Operator<\/h3>\n\n\n\n<p>Assignment operators are used to assign values to variables. The most fundamental assignment operator is \u201c<strong>=<\/strong>\u201d.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3542-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3542\" class=\"tablepress tablepress-id-3542 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Sub-category<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Same As<\/th><th class=\"column-6\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">=<\/td><td class=\"column-3\">&#8211;<\/td><td class=\"column-4\">$c = $d<\/td><td class=\"column-5\">$c = $d (the value of the right operand is assigned to the left operand)<\/td><td class=\"column-6\">Assign<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">+=<\/td><td class=\"column-3\">Arithmetic Assignment<\/td><td class=\"column-4\">$c += $d<\/td><td class=\"column-5\">$c = $c + $d<\/td><td class=\"column-6\">Addition<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">-=<\/td><td class=\"column-3\">Arithmetic Assignment<\/td><td class=\"column-4\">$c -= $d<\/td><td class=\"column-5\">$c = $c &#8211; $d<\/td><td class=\"column-6\">Subtraction<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">*=<\/td><td class=\"column-3\">Arithmetic Assignment<\/td><td class=\"column-4\">$c *= $d<\/td><td class=\"column-5\">$c = $c * $d<\/td><td class=\"column-6\">Multiplication<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">\/=<\/td><td class=\"column-3\">Arithmetic Assignment<\/td><td class=\"column-4\">$c \/= $d<\/td><td class=\"column-5\">$c = $c \/ $d<\/td><td class=\"column-6\">Division<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">%=<\/td><td class=\"column-3\">Arithmetic Assignment<\/td><td class=\"column-4\">$c %= $d<\/td><td class=\"column-5\">$c = $c % $d<\/td><td class=\"column-6\">Modulus<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">7<\/td><td class=\"column-2\">**=<\/td><td class=\"column-3\">Arithmetic Assignment<\/td><td class=\"column-4\">$c **= $d<\/td><td class=\"column-5\">$c = $c ** $d<\/td><td class=\"column-6\">Exponentiation<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">8<\/td><td class=\"column-2\">&amp;=<\/td><td class=\"column-3\">Bitwise Assignment<\/td><td class=\"column-4\">$c &amp;= $d<\/td><td class=\"column-5\">$c = $c &amp; $d<\/td><td class=\"column-6\">Bitwise And<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">9<\/td><td class=\"column-2\">|=<\/td><td class=\"column-3\">Bitwise Assignment<\/td><td class=\"column-4\">$c |= $d<\/td><td class=\"column-5\">$c = $c | $d<\/td><td class=\"column-6\">Bitwise Or<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">10<\/td><td class=\"column-2\">^=<\/td><td class=\"column-3\">Bitwise Assignment<\/td><td class=\"column-4\">$c ^= $d<\/td><td class=\"column-5\">$c = $c ^ $d<\/td><td class=\"column-6\">Bitwise Xor<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">11<\/td><td class=\"column-2\"><<=<\/td><td class=\"column-3\">Bitwise Assignment<\/td><td class=\"column-4\">$c <<= $d<\/td><td class=\"column-5\">$c = $c << $d<\/td><td class=\"column-6\">Left Shift<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">12<\/td><td class=\"column-2\">>>=<\/td><td class=\"column-3\">Bitwise Assignment<\/td><td class=\"column-4\">$c >>= $d<\/td><td class=\"column-5\">$c = $c >> $d<\/td><td class=\"column-6\">Right Shift<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td class=\"column-1\">13<\/td><td class=\"column-2\">.=<\/td><td class=\"column-3\">&#8211;<\/td><td class=\"column-4\">$c .= $d<\/td><td class=\"column-5\">$c = $c . $d<\/td><td class=\"column-6\">String Concatenation<\/td>\n<\/tr>\n<tr class=\"row-15\">\n\t<td class=\"column-1\">14<\/td><td class=\"column-2\">??=<\/td><td class=\"column-3\">&#8211;<\/td><td class=\"column-4\">$c ??= $d<\/td><td class=\"column-5\">$c = $c ?? $d<\/td><td class=\"column-6\">Null Coalesce<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3542 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = 2;  \n$d = 4;\necho ($c = $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 4\n\n$c = 2;  \n$d = 4;\necho ($c += $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 6\n\n$c = 2;  \n$d = 4;\necho ($c -= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: -2\n\n$c = 2;  \n$d = 4;\necho ($c *= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 8\n\n$c = 2;  \n$d = 4;\necho ($c \/= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 0.5\n\n$c = 2;  \n$d = 4;\necho ($c %= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 2\n\n$c = 2;  \n$d = 4;\necho ($c **= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 16\n\n$c = 2;  \n$d = 4;\necho ($c &amp;= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 0\n\n$c = 2;  \n$d = 4;\necho ($c |= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 6\n\n$c = 2;  \n$d = 4;\necho ($c ^= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 6\n\n$c = 2;  \n$d = 4;\necho ($c &lt;&lt;= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 32\n\n$c = 2;  \n$d = 4;\necho ($c &gt;&gt;= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 0\n\n$c = 2;  \n$d = 4;\necho ($c .= $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 24\n\n$c = 2;  \n$d = 4;\necho ($c ??= $d); \/\/outputs: 2\n?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#3) Comparison Operator<\/h3>\n\n\n\n<p>Comparison operators are used to compare values.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3543-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3543\" class=\"tablepress tablepress-id-3543 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\"> == <\/td><td class=\"column-3\">Equal<\/td><td class=\"column-4\">$c == $d<\/td><td class=\"column-5\">Return TRUE if $c is equal to $d<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\"> === <\/td><td class=\"column-3\">Identical<\/td><td class=\"column-4\">$c === $d<\/td><td class=\"column-5\">Return TRUE if $c is equal to $d, and they are of the same data type<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">!=<\/td><td class=\"column-3\">Not equal<\/td><td class=\"column-4\">$c != $d<\/td><td class=\"column-5\">Return TRUE if $c is not equal to $d<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\"><><\/td><td class=\"column-3\">Not equal<\/td><td class=\"column-4\">$c <> $d<\/td><td class=\"column-5\">Return TRUE if $c is not equal to $d<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">!==<\/td><td class=\"column-3\">Not identical<\/td><td class=\"column-4\">$c !== $d<\/td><td class=\"column-5\">Return TRUE if $c is not equal to $d, and they are not of the same data type<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\"><<\/td><td class=\"column-3\">Less than<\/td><td class=\"column-4\">$c < $d<\/td><td class=\"column-5\">Return TRUE if $c is less than $d<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">7<\/td><td class=\"column-2\">><\/td><td class=\"column-3\">Greater than<\/td><td class=\"column-4\">$c > $d<\/td><td class=\"column-5\">Return TRUE if $c is greater than $d<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">8<\/td><td class=\"column-2\"><=<\/td><td class=\"column-3\">Less than or equal to<\/td><td class=\"column-4\">$c <= $d<\/td><td class=\"column-5\">Return TRUE if $c is less than or equal to $d<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">9<\/td><td class=\"column-2\">>=<\/td><td class=\"column-3\">Greater than or equal to<\/td><td class=\"column-4\">$c >= $d<\/td><td class=\"column-5\">Return TRUE if $c is greater than or equal to $d<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">10<\/td><td class=\"column-2\"><=><\/td><td class=\"column-3\">Spaceship<\/td><td class=\"column-4\">$c <=>$d<\/td><td class=\"column-5\">Return -1, 0 or 1 when $c is less than, equal to, or greater than $d respectively.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3543 from cache -->\n\n\n<p><strong>Note:<\/strong>&nbsp;The following two operators are also referred to as PHP comparison operators.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The ternary operator (?:)<\/li>\n\n\n\n<li>The null coalescing operator (??)<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code. Output values are shown in the comments.<\/p>\n\n\n\n<p><strong>In the below example, 50 is an integer, and \u201c50\u201d is a string.<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = 50; \n$d = &quot;50&quot;; \n\nvar_dump($c == $d); \/\/outputs: bool(true) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c === $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c != $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c !== $d); \/\/outputs: bool(true) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &lt;&gt; $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &lt; $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &gt; $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &lt;= $d); \/\/outputs: bool(true) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &gt;= $d);\/\/outputs: bool(true) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &lt;=&gt;$d); \/\/outputs: int(0) \n?&gt;  \n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#4) Incrementing and Decrementing Operators<\/h3>\n\n\n\n<p>Incrementing and decrementing operators are used to increase and decrease the value of a variable.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3544-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3544\" class=\"tablepress tablepress-id-3544 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">++<\/td><td class=\"column-3\">Pre-increment<\/td><td class=\"column-4\">++$c<\/td><td class=\"column-5\">Increment the value of $c by one and then return $c<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">++<\/td><td class=\"column-3\">Post-increment<\/td><td class=\"column-4\">$c++<\/td><td class=\"column-5\">Return $c (and then increment the value of $c by one)<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">&#8212;<\/td><td class=\"column-3\">Pre-decrement<\/td><td class=\"column-4\">&#8211;$c<\/td><td class=\"column-5\">Decrement the value of $c by one and then return $c<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">&#8212;<\/td><td class=\"column-3\">Post-decrement<\/td><td class=\"column-4\">$c&#8211;<\/td><td class=\"column-5\">Return $c (and then decrement the value of $c by one)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3544 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code is an example. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = 50; \necho ++$c.&quot;&lt;br&gt;&quot;; \/\/outputs: 51\n\n$c = 50; \necho $c++.&quot;&lt;br&gt;&quot;; \/\/outputs: 50\n\n$c = 50; \necho --$c.&quot;&lt;br&gt;&quot;; \/\/outputs: 49\n\n$c = 50; \necho $c--; \/\/outputs: 50\n?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#5) Bitwise Operator<\/h3>\n\n\n\n<p>A bitwise operator is used to perform bit-level operations.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3545-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3545\" class=\"tablepress tablepress-id-3545 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">&amp;<\/td><td class=\"column-3\">Bitwise And<\/td><td class=\"column-4\">$c &amp; $d<\/td><td class=\"column-5\">Bits that are set in both $c and $d are set.<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">|<\/td><td class=\"column-3\">Bitwise Or (Inclusive Or)<\/td><td class=\"column-4\">$c | $d<\/td><td class=\"column-5\">Bits that are set in either $c or $d are set.<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">^<\/td><td class=\"column-3\">Bitwise Xor (Exclusive Or)<\/td><td class=\"column-4\">$c ^ $d<\/td><td class=\"column-5\">Bits that are set in $c or $d but not both are set.<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">~<\/td><td class=\"column-3\">Bitwise Not<\/td><td class=\"column-4\">~$c<\/td><td class=\"column-5\">Bits that are set in $c are not set, and vice versa.<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\"><<<\/td><td class=\"column-3\">Bitwise Left Shift<\/td><td class=\"column-4\">$c << $d<\/td><td class=\"column-5\">Shift the bits of $c $d steps to the left (each step means &#8220;multiply by two&#8221;)<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">>><\/td><td class=\"column-3\">Bitwise Right Shift<\/td><td class=\"column-4\">$c >> $d<\/td><td class=\"column-5\">Shift the bits of $c $d steps to the right (each step means &#8220;divide by two&#8221;)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3545 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = 2; \n$d = 4;\n\necho($c &amp; $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 0 \n\necho($c | $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 6\n\necho($c ^ $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 6\n\necho(~$c).&quot;&lt;br&gt;&quot;; \/\/outputs: -3\n\necho($c &lt;&lt; $d).&quot;&lt;br&gt;&quot;; \/\/outputs: 32\n\necho($c &gt;&gt; $d); \/\/outputs: 0\n?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#6) Logical Operator<\/h3>\n\n\n\n<p>A logical operator is used to integrate conditional statements.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3546-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3546\" class=\"tablepress tablepress-id-3546 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">and<\/td><td class=\"column-3\">And<\/td><td class=\"column-4\">$c and $d<\/td><td class=\"column-5\">Return TRUE if both $c and $d are true<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">or<\/td><td class=\"column-3\">Or<\/td><td class=\"column-4\">$c or $d<\/td><td class=\"column-5\">Return TRUE if either $c or $d is true<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">xor<\/td><td class=\"column-3\">Xor<\/td><td class=\"column-4\">$c xor $d<\/td><td class=\"column-5\">Return TRUE if either $c or $d is true, but not both<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">!<\/td><td class=\"column-3\">Not<\/td><td class=\"column-4\">!$c<\/td><td class=\"column-5\">Return TRUE if $c is not true<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">&amp;&amp;<\/td><td class=\"column-3\">And<\/td><td class=\"column-4\">$c &amp;&amp; $d<\/td><td class=\"column-5\">Return TRUE if both $c and $d are true<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">||<\/td><td class=\"column-3\">Or<\/td><td class=\"column-4\">$c || $d<\/td><td class=\"column-5\">Return TRUE if either $c or $d is true<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3546 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = true; \n$d = false;\n\nvar_dump($c and $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c or $d); \/\/outputs: bool(true) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c xor $d); \/\/outputs: bool(true) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump(!$c); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &amp;&amp; $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c || $d); \/\/outputs: bool(true) \n?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#7) String Operator<\/h3>\n\n\n\n<p>A string operator is used to perform operations on strings.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3547-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3547\" class=\"tablepress tablepress-id-3547 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">.<\/td><td class=\"column-3\">Concatenation<\/td><td class=\"column-4\">$c . $d<\/td><td class=\"column-5\">Concatenate $c and $d<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">.=<\/td><td class=\"column-3\">Concatenating assignment<\/td><td class=\"column-4\">$c .= $d<\/td><td class=\"column-5\">Appends $d to $c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3547 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$c = &quot;My&quot;;\n$d = &quot; Home&quot;;\n\necho $c . $d .&quot;&lt;br&gt;&quot;; \/\/outputs: My Home\n\necho $c .= $d; \/\/outputs: My Home\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#8) Array Operator<\/h3>\n\n\n\n<p>They are used to performing operations on arrays. They are usually comparing the values of arrays.<\/p>\n\n\n\n<p><strong>The table below shows more details:<\/strong><\/p>\n\n\n\n<div id=\"tablepress-3548-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3548\" class=\"tablepress tablepress-id-3548 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Symbol<\/th><th class=\"column-3\">Name<\/th><th class=\"column-4\">Syntax<\/th><th class=\"column-5\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">+<\/td><td class=\"column-3\">Union<\/td><td class=\"column-4\">$c + $d<\/td><td class=\"column-5\">Union of $c and $d<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\"> ==<\/td><td class=\"column-3\">Equality<\/td><td class=\"column-4\">$c == $d<\/td><td class=\"column-5\">Return TRUE if $c and $d have the same key-value pair<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\"> ===<\/td><td class=\"column-3\">Identity<\/td><td class=\"column-4\">$c === $d<\/td><td class=\"column-5\">Return TRUE if $c and $d have the same key-value pair in the same order and of the same type<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">!=<\/td><td class=\"column-3\">Inequality<\/td><td class=\"column-4\">$c != $d<\/td><td class=\"column-5\">Return TRUE if $c is not equal to $d<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\"><><\/td><td class=\"column-3\">Inequality<\/td><td class=\"column-4\">$c <> $d<\/td><td class=\"column-5\">Return TRUE if $c is not equal to $d<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">!==<\/td><td class=\"column-3\">Non-Identity<\/td><td class=\"column-4\">$c !== $d<\/td><td class=\"column-5\">Return TRUE if $c is not identical to $d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3548 from cache -->\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$c = array(&quot;a&quot; =&gt; &quot;Red&quot;, &quot;b&quot; =&gt; &quot;Yellow&quot;, &quot;c&quot; =&gt; &quot;Green&quot;);\n$d = array(&quot;d&quot; =&gt; &quot;Pink&quot;, &quot;e&quot; =&gt; &quot;Orange&quot;, &quot;f&quot; =&gt; &quot;Blue&quot;);\n\nvar_dump($c + $d);\necho &quot;&lt;br&gt;&quot;; \/\/outputs: array(6) { &#x5B;&quot;a&quot;]=&gt; string(3) &quot;Red&quot; &#x5B;&quot;b&quot;]=&gt; string(6) &quot;Yellow&quot; &#x5B;&quot;c&quot;]=&gt; string(5) &quot;Green&quot; &#x5B;&quot;d&quot;]=&gt; string(4) &quot;Pink&quot; &#x5B;&quot;e&quot;]=&gt; string(6) &quot;Orange&quot; &#x5B;&quot;f&quot;]=&gt; string(4) &quot;Blue&quot; } \n\nvar_dump($c == $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c === $d); \/\/outputs: bool(false) \necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c != $d);  \/\/outputs: bool(true)\necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c &lt;&gt; $d); \/\/outputs: bool(true)\necho &quot;&lt;br&gt;&quot;;\n\nvar_dump($c !== $d);  \/\/outputs: bool(true)\n?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#9) Type Operator<\/h3>\n\n\n\n<p>PHP has a type operator called <strong>instanceof,<\/strong> and its function is to determine which class an object belongs to. It is used in object-oriented programming.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code. Output values are shown in the comments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\t&lt;?php\n    class AnimalClass\n\t{\n\t}\n\n\tclass NotAnimalClass\n\t{\n\t}\n\t$a = new AnimalClass;\n\n\tvar_dump($a instanceof AnimalClass); \/\/outputs: bool(true) \n\tvar_dump($a instanceof NotAnimalClass); \/\/outputs: bool(false) \n    ?&gt;\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#10) Execution Operator<\/h3>\n\n\n\n<p>PHP has only one execution operator, backticks (<strong>&#8220;<\/strong>). PHP executes the content inside the backticks as a shell command. It is similar to the <strong>shell_exec()<\/strong> function, and both give the same result.<\/p>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;Backticks (&#8220;) are not single quotes.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The below programming code shows an example. You can try this example by running the following code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\t\n    $list=`dir`;\n\techo &quot;$list&quot;;\n?&gt;\n<\/pre><\/div>\n\n\n<p>It will show available directories in the current directory as the output.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">#11) Error Control Operator<\/h3>\n\n\n\n<p>PHP has only one error control operator, the at symbol (<strong>@<\/strong>). When you prefix it to any expression, any error message encountered by the expression will be ignored.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>The following example elaborates on the functionality of the error control operator. You can try this example by running the following code. Assume that the file, missingfile.txt does not exist.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Code A &#8211; Without @<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n &lt;?php\n    echo &quot;My File&quot;;\n\t$fp=fopen(&quot;missingfile.txt&quot;,&quot;r&quot;);\n?&gt;\n<\/pre><\/div>\n\n\n<p>The following text shows the browser output of the above programming code. As there is no @, the error will be displayed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">My File\n<strong>Warning<\/strong>: fopen(missingfile.txt): Failed to open stream: No such file or directory in <strong>C:\\xampp\\htdocs\\test.php<\/strong> on line <strong>3<\/strong><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Code B &#8211; With @<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\t\n    echo &quot;My File&quot;;\n\t$fp=@fopen(&quot;missingfile.txt&quot;,&quot;r&quot;);\n?&gt;\n<\/pre><\/div>\n\n\n<p>The text below shows the browser output of the above programming code. As there is @ before fopen, the error will not be displayed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">My File<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Precedence of Operators<\/h2>\n\n\n\n<p>The operator precedence determines the order in which operators are going to executed.<\/p>\n\n\n\n<p>The following table shows the operators in order of precedence from the highest precedence (at the top) to the lowest precedence (at the bottom). Furthermore, the operators on the same line have equal precedence.<\/p>\n\n\n\n<div id=\"tablepress-3549-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-3549\" class=\"tablepress tablepress-id-3549 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Operator<\/th><th class=\"column-3\">Description<\/th><th class=\"column-4\">Associativity<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">clone new<\/td><td class=\"column-3\">clone and new<\/td><td class=\"column-4\">(n\/a)<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">**<\/td><td class=\"column-3\">Arithmetic<\/td><td class=\"column-4\">right<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">+<br \/>\n&#8211;<br \/>\n++<br \/>\n&#8212;<br \/>\n~<br \/>\n(int)<br \/>\n(float)<br \/>\n(string)<br \/>\n(array)<br \/>\n(object)<br \/>\n(bool)<br \/>\n@<\/td><td class=\"column-3\">Arithmetic (unary +)<br \/>\nArithmetic (unary -)<br \/>\nIncrement<br \/>\nDecrement<br \/>\nBitwise<br \/>\nType<br \/>\nType<br \/>\nType<br \/>\nType<br \/>\nType<br \/>\nType<br \/>\nError control <\/td><td class=\"column-4\">(n\/a)<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">instanceof<\/td><td class=\"column-3\">Type<\/td><td class=\"column-4\">Left <\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">!<\/td><td class=\"column-3\">Logical<\/td><td class=\"column-4\">(n\/a)<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">*<br \/>\n\/<br \/>\n%<\/td><td class=\"column-3\">Arithmetic<br \/>\nArithmetic<br \/>\nArithmetic<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">7<\/td><td class=\"column-2\">+<br \/>\n&#8211;<br \/>\n.<\/td><td class=\"column-3\">Arithmetic (binary +)<br \/>\nArithmetic (binary -)<br \/>\nString  <\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">8<\/td><td class=\"column-2\"><<\u00a0<br \/>\n>><\/td><td class=\"column-3\">Bitwise<br \/>\nBitwise<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">9<\/td><td class=\"column-2\"><<br \/>\n<=<br \/>\n><br \/>\n>=<\/td><td class=\"column-3\">Comparison<br \/>\nComparison<br \/>\nComparison<br \/>\nComparison<br \/>\n<\/td><td class=\"column-4\">Non-associative<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">10<\/td><td class=\"column-2\"> ==<br \/>\n !=<br \/>\n ===<br \/>\n !==<br \/>\n <><br \/>\n <=><\/td><td class=\"column-3\">Comparison<br \/>\nComparison<br \/>\nComparison<br \/>\nComparison<br \/>\nComparison<br \/>\nComparison<\/td><td class=\"column-4\">Non-associative<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">11<\/td><td class=\"column-2\">&amp;<\/td><td class=\"column-3\">Bitwise and reference<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">12<\/td><td class=\"column-2\">^<\/td><td class=\"column-3\">Bitwise<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td class=\"column-1\">13<\/td><td class=\"column-2\">|<\/td><td class=\"column-3\">Bitwise<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-15\">\n\t<td class=\"column-1\">14<\/td><td class=\"column-2\">&amp;&amp;<\/td><td class=\"column-3\">Logical<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-16\">\n\t<td class=\"column-1\">15<\/td><td class=\"column-2\">||<\/td><td class=\"column-3\">Logical<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-17\">\n\t<td class=\"column-1\">16<\/td><td class=\"column-2\">??<\/td><td class=\"column-3\">Null coalescing<\/td><td class=\"column-4\">Right<\/td>\n<\/tr>\n<tr class=\"row-18\">\n\t<td class=\"column-1\">17<\/td><td class=\"column-2\">?:<\/td><td class=\"column-3\">Ternary<\/td><td class=\"column-4\">Left associative<br \/>\n(Non-associative in PHP 8.0.0)<\/td>\n<\/tr>\n<tr class=\"row-19\">\n\t<td class=\"column-1\">18<\/td><td class=\"column-2\"> =<br \/>\n+=<br \/>\n-=<br \/>\n*=<br \/>\n**=<br \/>\n\/=<br \/>\n.=<br \/>\n%=<br \/>\n&amp;=<br \/>\n|=<br \/>\n^=<br \/>\n<<=<br \/>\n>>=<br \/>\n??=<\/td><td class=\"column-3\">Assignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<br \/>\nAssignment<\/td><td class=\"column-4\">Right<\/td>\n<\/tr>\n<tr class=\"row-20\">\n\t<td class=\"column-1\">19<\/td><td class=\"column-2\">yield from<\/td><td class=\"column-3\">Yield from<\/td><td class=\"column-4\">(n\/a)<\/td>\n<\/tr>\n<tr class=\"row-21\">\n\t<td class=\"column-1\">20<\/td><td class=\"column-2\">yield<\/td><td class=\"column-3\">Yield<\/td><td class=\"column-4\">(n\/a)<\/td>\n<\/tr>\n<tr class=\"row-22\">\n\t<td class=\"column-1\">21<\/td><td class=\"column-2\">print<\/td><td class=\"column-3\">Print<\/td><td class=\"column-4\">(n\/a)<\/td>\n<\/tr>\n<tr class=\"row-23\">\n\t<td class=\"column-1\">22<\/td><td class=\"column-2\">and<\/td><td class=\"column-3\">Logical<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-24\">\n\t<td class=\"column-1\">23<\/td><td class=\"column-2\">xor<\/td><td class=\"column-3\">Logical<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<tr class=\"row-25\">\n\t<td class=\"column-1\">24<\/td><td class=\"column-2\">or<\/td><td class=\"column-3\">Logical<\/td><td class=\"column-4\">Left<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-3549 from cache -->\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p>In this section, we will discuss some of the FAQs related to this topic. These questions will help you prepare for your examinations and interviews confidently.<\/p>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1750779953966\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>1. What are PHP operators?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>They are symbols used to perform operations on operands.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750779980092\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>2. How many operators are there in PHP?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>There are 11 operators in PHP.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750780002956\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>3. Does PHP have ++?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>Yes, they are called incrementing operators.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750780023364\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>4. Is PHP += a logical operator?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>No, it is not. It is an assignment operator.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750780049215\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>5. Are Bitwise operations faster than arithmetic operations?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>Yes, they are usually faster than arithmetic operations.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750780074991\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>6. What is the difference between == and === in PHP?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>When you consider PHP == vs ===, PHP == is the equal operator that checks whether the two operands have the same value. On the other hand, PHP === is the identical operator that checks whether the two operands have the same value and the same type.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750780103725\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>7. What is the difference between i++ and ++i in PHP?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>++i increments the value of i by one and then returns i. Unlike ++i, i++ returns i first and then increments the value of i by one.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1750780133129\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>8. What are the main differences between bitwise AND and logical AND operators?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>Bitwise AND is represented as \u201c&amp;\u201d and logical AND is represented as \u201c&amp;&amp;\u201d. Logical AND works only on the boolean data type, but bitwise AND works on both boolean and other data types such as int, short, etc<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>PHP operators can be divided into 11 categories named arithmetic, assignment, comparison, incrementing\/decrementing, bitwise, logical, string, array, type, execution, and error control operators.<\/p>\n\n\n\n<p>The operator precedence determines the order in which operators are going to executed.<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/php\/php-data-types-and-keywords\/\">PREV Tutorial<\/a> | <a href=\"https:\/\/www.softwaretestinghelp.com\/php\/php-variables\/\">NEXT Tutorial<\/a><\/strong><\/p>\n\n\n\n<p><\/p>\n\r\n\t\t\t<div id=\"daexthefup-container\"\r\n\t\t\t\tclass=\"daexthefup-container daexthefup-layout-stacked daexthefup-alignment-center\"\r\n\t\t\t\tdata-post-id=\"202709\">\r\n\r\n\t\t\t\t<div class=\"daexthefup-feedback\">\r\n\t\t\t\t\t<div class=\"daexthefup-text\">\r\n\t\t\t\t\t\t<h3 class=\"daexthefup-title\">Was this helpful?<\/h3>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"daexthefup-buttons-container\">\r\n\t\t\t\t\t\t<div class=\"daexthefup-buttons\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-yes daexthefup-button daexthefup-button-type-icon\" data-value=\"1\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-up-cls-1{fill:#c9c9c9;}.thumb-up-cls-2{fill:#e1e1e1;}.thumb-up-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_up\">\r\n                        <path class=\"thumb-up-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-up-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"20\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,9.06l-.49-.1c-.81-.17-1.61.35-1.78,1.16l-5.3,11.74c-.17.81,3.16,1.61,3.97,1.78l1.96.41c.81.17,1.61-.35,1.78-1.16l2.18-10.27c.34-1.61-.7-3.21-2.31-3.56Z\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,20h-18.67c-.83,0-1.5.67-1.5,1.5v12c0,.83.67,1.5,1.5,1.5h16.27c.71,0,1.33-.5,1.47-1.21l2.4-12c.19-.93-.53-1.8-1.47-1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-no daexthefup-button daexthefup-button-type-icon\" data-value=\"0\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-down-cls-1{fill:#c9c9c9;}.thumb-down-cls-2{fill:#e1e1e1;}.thumb-down-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_down\">\r\n                        <path class=\"thumb-down-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-down-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"13\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,38.94l-.49.1c-.81.17-1.61-.35-1.78-1.16l-5.3-11.74c-.17-.81,3.16-1.61,3.97-1.78l1.96-.41c.81-.17,1.61.35,1.78,1.16l2.18,10.27c.34,1.61-.7,3.21-2.31,3.56Z\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,28h-18.67c-.83,0-1.5-.67-1.5-1.5v-12c0-.83.67-1.5,1.5-1.5h16.27c.71,0,1.33.5,1.47,1.21l2.4,12c.19.93-.53,1.8-1.47,1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-comment\">\r\n\t\t\t\t\t<div class=\"daexthefup-comment-top-container\">\r\n\t\t\t\t\t\t<label id=\"daexthefup-comment-label\" class=\"daexthefup-comment-label\"><\/label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-container\">\r\n\t\t\t\t\t\t\t\t<div id=\"daexthefup-comment-character-counter-number\"\r\n\t\t\t\t\t\t\t\t\tclass=\"daexthefup-comment-character-counter-number\"><\/div>\r\n\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-text\"><\/div>\r\n\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<textarea id=\"daexthefup-comment-textarea\" class=\"daexthefup-comment-textarea\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"Type your message\"\r\n\t\t\t\t\t\t\t\tmaxlength=\"\r\n\t\t\t\t\t\t\t\t400\t\t\t\t\t\t\t\t\t\"><\/textarea>\r\n\t\t\t\t\t<div class=\"daexthefup-comment-buttons-container\">\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-submit daexthefup-button\">Submit<\/button>\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-cancel daexthefup-button\">Cancel<\/button>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-successful-submission-text\">Thanks for your feedback!<\/div>\r\n\r\n\t\t\t<\/div>\r\n\r\n\t\t\t","protected":false},"excerpt":{"rendered":"<p>PHP Operators are the special symbols or strings for operations on PHP variables &amp; values. Discover the different categories of PHP Operators with simple programming code examples: In this tutorial, you will learn about PHP operators (like PHP assignment operators, PHP comparison operators, PHP ternary operators, and many more), the &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"PHP Operators: Classification With Examples\" class=\"read-more button\" href=\"https:\/\/www.softwaretestinghelp.com\/php\/php-operators\/#more-202709\" aria-label=\"Read more about PHP Operators: Classification With Examples\">Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":203095,"parent":392052,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_helpful_pro_status":1,"footnotes":""},"categories":[412],"tags":[],"class_list":{"0":"post-202709","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"category-php"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/202709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/comments?post=202709"}],"version-history":[{"count":0,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/202709\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/392052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media\/203095"}],"wp:attachment":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media?parent=202709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/categories?post=202709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/tags?post=202709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}