From a756dc9772cf6b9d2307bb714fd2203bc350e3a5 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Fri, 14 Nov 2008 00:38:36 +0000 Subject: [PATCH] add encoding directive to declare documentation git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@268981 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/control-structures.xml | 49 ++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/language/control-structures.xml b/language/control-structures.xml index 06fb4bf6f0..fdc2688609 100644 --- a/language/control-structures.xml +++ b/language/control-structures.xml @@ -1,5 +1,5 @@ - + Control Structures @@ -1171,12 +1171,20 @@ declare (directive) The directive section allows the behavior of the declare block to be set. - Currently only one directive is recognized: the - ticks directive. (See below for more + Currently only two directives are recognized: the + ticks directive (See below for more information on the ticks - directive) + directive) and the encoding directive (See below for more + information on the + encoding + directive). + + + The encoding directive was added in PHP 5.3.0 + + The statement part of the declare block will be executed - how @@ -1287,6 +1295,39 @@ print_r(profile(TRUE)); unregister_tick_function. + + Encoding + + + Declaring an encoding for the script. + + A script's encoding can be specified per-script using the encoding directive. + + +]]> + + + + + + + When combined with namespaces, the only legal syntax for declare + is declare(encoding='...'); where ... + is the encoding value. declare(encoding='...') {} + will result in a parse error when combined with namespaces. + + + + The encoding declare value is ignored in PHP 5.3 unless php is compiled with + --enable-zend-multibyte. In PHP 6.0, the encoding + directive will be used to inform the scanner what encoding the file is created in. Legal + values are encoding names such as UTF-8. + +