PHP enddeclare 关键字
实例
关闭一个声明块:
<?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;
?>
亲自试一试 »
$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;
?>
定义和用法
enddeclare
关键字用于关闭一个declare
使用 declare(...):
语法启动的块。
相关页面
declare 关键字。