Webmaster Tools


   Webmaster Tools

«Note for Java developers: the ‘final’ keyword is not used for class constants in PHP. We use the keyword ‘const’. » This is more or less true, regardless of the fact that constant (being defined at class level or not) in PHP are only scalar (int, string, etc) while in Java they may be pure object (ex: java. awat.

Color. BLACK). The only possible solution of having such kind of constant is :. php {.

.. }. That said, perhaps it is useless unless PHP automatically calls the __init() method.

However, one alternative that could be done in certain case is this :. php…

require… ,, if (.

if (. (. ‘ __init() method must be private and static. ‘.

This can only work when one class is defined per file, since we are assured that __autoload() will be called to load the file containing the class. test2. php:. php,,,,.

test. php:. php ‘test2. php’.

.. do..

. // shows B, then array(2) (1, 2) // shows NULL.

Категория: Авиабилеты
Вы можете следить за комментариями через RSS 2.0 фид. Вы можете оставить ответ, или трекбек Вашего сайта.