PHP enddeclare Keyword

PHP endfor Keyword
PHP empty Keyword

In this article, you will learn about enddeclare keyword in PHP. The enddeclare keyword in PHP is used to close a declare block which was started using the declare(…): syntax.

examples of the ENDDECLARE keyword

Example 1. In this example, we close a declare block.

$count = 0;
function example() {
  global $count;
  echo "$count instructions executed<br>";

  $cars = ["Ford", "Volvo", "BMW"];
  foreach($cars as $car) {
    echo "$car <br>";
PHP endfor Keyword
PHP empty Keyword

Tutor Network

Share this

Learn PHP from A to Z