“Php/keyword enddeclare”的版本间差异

来自菜鸟教程
跳转至:导航、​搜索
(Bot commit)
 
(机器人:添加分类Php基础教程
 
第1行: 第1行:
 
 
= PHP enddeclare关键字 =
 
= PHP enddeclare关键字 =
  
第50行: 第49行:
  
 
[[../php_ref_keywords|Keywords PHP关键字]]<br />
 
[[../php_ref_keywords|Keywords PHP关键字]]<br />
 +
 +
[[分类:Php基础教程]]

2020年11月12日 (四) 08:45的最新版本

PHP enddeclare关键字

Keywords PHP关键字

关闭一个声明块:

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

  register_tick_function('example');

declare(ticks=1):
  $cars = 
  ["Ford", "Volvo", "BMW"];
  foreach($cars as $car) {
    
  echo "$car <br>";
  }
enddeclare;
?>

定义和用法

The enddeclare 关键字用于关闭 declare 使用开始的块 declare(...): 句法。

相关页面

The 宣布

关键词。

Keywords PHP关键字