XWare Поиск по информационным ресурсам МГУ English Russian
       
       Точная форма слов   О проекте   Сайты   Помощь
Поиск по:old.hcs.cmc.msu.ru   - Поискать по всем серверам
На этой странице приведены все страницы сервера old.hcs.cmc.msu.ru ,которые мы индексируем. Показаны документы 3181 - 3200 из 3520.

В начало ] Пред. | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | След.В конец ]

Упорядочить по: URL  |  дате изменения
3181. Classes and Objects
... class . ... Serializing objects - objects in sessions . ... php class Cart { var $items; // Items in our shopping cart // Add $num articles of $artnr to the cart function add_item ($artnr, $num) { $this->items[$artnr] += $num; } // Take $num articles of $artnr out of the cart function remove_item ($artnr, $num) { if ($this->items[$artnr] > $num) { $this->items[$artnr] -= $num; return true; } else { return false; } } } ?> ... This creates the objects $cart and $another_cart, both of the class Cart. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/language.oop.html -- 9.8 Кб -- 03.02.2002
Похожие документы

3182. The magic functions __sleep and __wakeup
... Classes and Objects . ... serialize() checks if your class has a function with the magic name __sleep . ... The intended use of __sleep is to close any database connections that object may have, committing pending data or perform similar cleanup tasks. Also, the function is useful if you have very large objects which need not be saved completely. Conversely, unserialize() checks for the presence of a function with the magic name __wakeup . ... Serializing objects - objects in sessions . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/language.oop.magic-functions.html -- 4.3 Кб -- 03.02.2002
Похожие документы

3183. References inside the constructor
... Classes and Objects . ... Creating references within the constructor can lead to confusing results. This tutorial-like section helps you to avoid problems. class Foo { function Foo($name) { // create a reference inside the global array $globalref global $globalref; $globalref[] = &$this; // set name to passed value $this->setName($name); // and put it out $this->echoName(); } function echoName() { echo "<br>",$this->name; } function setName($name) { $this->name = $name; } } . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/language.oop.newref.html -- 7.8 Кб -- 03.02.2002
Похожие документы

3184. Serializing objects - objects in sessions
PHP Manual . ... Classes and Objects . ... Note: In PHP 3, objects will lose their class association throughout the process of serialization and unserialization. ... In order to be able to unserialize() an object, the class of that object needs to be defined. ... If you are using sessions and use session_register() to register objects, these objects are serialized automatically at the end of each PHP page, and are unserialized automatically on each of the following pages. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/language.oop.serialization.html -- 6.8 Кб -- 03.02.2002
Похожие документы

3185. extends
... Classes and Objects . ... Often you need classes with similar variables and functions to another existing class. ... The extended or derived class has all variables and functions of the base class (this is called 'inheritance' despite the fact that nobody died) and what you add in the extended definition. ... Classes are extended using the keyword 'extends'. class Named_Cart extends Cart { var $owner; function set_owner ($name) { $this->owner = $name; } } . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/keyword.extends.html -- 4.8 Кб -- 03.02.2002
Похожие документы

3186. ::
... Classes and Objects . Next . ... The :: operator is being used for this. class A { function example () { echo I am the original function A:: example (). br \n ; } } class B extends A { function example () { echo I am the redefined function B:: example (). br \n ; A:: example (); } } // there is no object of class A. // this will print // I am the original function A:: example (). br A:: ... There are class functions, but there are no class variables. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/keyword.paamayim-nekudotayim.html -- 5.4 Кб -- 03.02.2002
Похожие документы

3187. parent
... Classes and Objects . ... You may find yourself writing code that refers to variables and functions in base classes. This is particularly true if your derived class is a refinement or specialisation of code in your base class. Instead of using the literal name of the base class in your code, you should be using the special name parent , which refers to the name of your base class as given in the extends declation of your class. ... Serializing objects - objects in sessions ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/keyword.parent.html -- 4.4 Кб -- 03.02.2002
Похожие документы

3188. Constructors
... Constructors are functions in a class that are automatically called when you create a new instance of a class with new . In PHP 3, a function becomes a constructor when it has the same name as the class. ... The following examples should be read carefully to understand these limitations. class A { function A() { echo "I am the constructor of A.<br>\n"; } } class B extends A { function C() { echo "I am a regular function.<br>\n"; } } // no constructor is being called in PHP 3. $b = new B; . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/language.oop.constructor.html -- 8.6 Кб -- 03.02.2002
Похожие документы

3189. Functions
PHP Manual . Prev . Next . ... User-defined functions . Function arguments . ... In PHP 3, functions must be defined before they are referenced. ... PHP 3 does not support variable numbers of arguments to functions, although default arguments are supported (see Default argument values for more information). PHP 4 supports both: see Variable-length argument lists and the function references for func_num_args() , func_get_arg() , and func_get_args() for more information. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/functions.html -- 5.0 Кб -- 03.02.2002
Похожие документы

3190. old_function
... Functions . ... The old_function statement allows you to declare a function using a syntax identical to PHP/FI2 (except you must replace 'function' with 'old_function'. ... Functions declared as old_function cannot be called from PHP's internal code. Among other things, this means you can't use them in functions such as usort() , array_walk() , and register_shutdown_function() . You can get around this limitation by writing a wrapper function (in normal PHP 3 form) to call the old_function . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/functions.old-syntax.html -- 4.1 Кб -- 03.02.2002
Похожие документы

3191. Returning values
... Prev . ... Functions . Next . Values are returned by using the optional return statement. Any type may be returned, including lists and objects. ... See return() for more information. function square ($num) { return $num * $num; } echo square (4); // outputs '16'. You can't return multiple values from a function, but similar results can be obtained by returning a list. function small_numbers() { return array (0, 1, 2); } list ($zero, $one, $two) = small_numbers(); . ... old_function ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/functions.returning-values.html -- 4.6 Кб -- 03.02.2002
Похожие документы

3192. Variable functions
PHP Manual . ... Functions . ... PHP supports the concept of variable functions. ... Variable functions won't work with language constructs such as echo() , unset() , isset() and empty() . This is one of the major differences between PHP functions and language constructs. ... Variable function example . php function foo() { echo "In foo()<br>\n"; } function bar($arg = '') { echo "In bar(); argument was '$arg'.<br>\n"; } $func = 'foo'; $func(); $func = 'bar'; $func('test'); ?> ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/functions.variable-functions.html -- 4.3 Кб -- 03.02.2002
Похожие документы

3193. Control Structures
... Alternative syntax for control structures . ... Any PHP script is built out of a series of statements. A statement can be an assignment, a function call, a loop, a conditional statement of even a statement that does nothing (an empty statement). ... In addition, statements can be grouped into a statement-group by encapsulating a group of statements with curly braces. ... if (expr) statement . As described in the section about expressions , expr is evaluated to its Boolean value. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/control-structures.html -- 8.0 Кб -- 03.02.2002
Похожие документы

3194. include_once
PHP Manual . ... The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. ... For more examples on using require_once() and include_once() , look at the PEAR code included in the latest PHP source code distributions. Note: include_once() was added in PHP 4.0.1pl2 . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/function.include-once.html -- 5.1 Кб -- 03.02.2002
Похожие документы

3195. Function arguments
... Functions . ... function takes_array($input) { echo "$input[0] + $input[1] = ", $input[0]+$input[1]; } . ... A function may define C++-style default values for scalar arguments as follows: . function makecoffee ($type = "cappucino") { return "Making a cup of $type.\n"; } echo makecoffee (); echo makecoffee ("espresso"); . ... function makeyogurt ($type = "acidophilus", $flavour) { return "Making a bowl of $type $flavour.\n"; } echo makeyogurt ("raspberry"); // won't work as expected . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/functions.arguments.html -- 8.3 Кб -- 03.02.2002
Похожие документы

3196. include
PHP Manual . ... The include() statement includes and evaluates the specified file. ... Basic include() example . ... Won't work; file.txt wasn't handled by www.example.com as PHP include 'http://www.example.com/file.txt?foo=1&bar=2'; // Won't work; looks for a file named 'file.php?foo=1&bar=2' on the // local filesystem. include 'file.php?foo=1&bar=2'; // Works. include 'http://www.example.com/file.php?foo=1&bar=2'; $foo = 1; $bar = 2; include 'file.txt'; // Works. include 'file.php'; // Works. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/function.include.html -- 11.9 Кб -- 03.02.2002
Похожие документы

3197. require_once
PHP Manual . ... The require_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the require() statement, with the only difference being that if the code from a file has already been included, it will not be included again. ... For examples on using require_once() and include_once() , look at the PEAR code included in the latest PHP source code distributions. Note: require_once() was added in PHP 4.0.1pl2 . ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/function.require-once.html -- 5.3 Кб -- 03.02.2002
Похожие документы

3198. require
... The require() statement includes and evaluates the specific file. require() includes and evaluates a specific file. Detailed information on how this inclusion works is described in the documentation for include() . ... Note: Prior to PHP 4.0.2, the following applies: require() will always attempt to read the target file, even if the line it's on never executes. ... However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/function.require.html -- 6.7 Кб -- 03.02.2002
Похожие документы

3199. declare
PHP Manual . ... The declare construct is used to set execution directives for a block of code. ... pre ? php // A function that records the time when it is called function profile ($dump = FALSE) { static $ profile ; // Return the times stored in profile , then erase it if ($dump) { $temp = $ profile ; unset ($ profile ); return ($temp); } $ profile [] = microtime (); } // Set up a tick handler register_ tick _function( profile ); // Initialize the function before the declare block ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/control-structures.declare.html -- 6.8 Кб -- 03.02.2002
Похожие документы

3200. return
... If called from within a function, the return() statement immediately ends execution of the current function, and returns its argument as the value of the function call. return() will also end the execution of an eval() statement or script file. ... If the current script file was include() ed or require() ed, then control is passed back to the calling file. Furthermore, if the current script file was include() ed, then the value given to return() will be returned as the value of the include() call. ...
[ Сохраненная копия ]  Ссылки http://old.hcs.cmc.msu.ru/php/function.return.html -- 5.2 Кб -- 03.02.2002
Похожие документы

В начало ] Пред. | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | След.В конец ]

Rambler's Top100 RFBR Яндекс цитирования