|
| |
|
|
| |
для: Евгений Петров
(09.01.2007 в 16:21)
| | | в PHP нет указателей ;) Это ссылка на вызываемый объект.
A pseudo-variable, $this is available when a method is called from within an object context.
$this is a reference to the calling object (usually the object to which the method belongs,
but can be another object, if the method is called statically from the context of a secondary object).
This is illustrated in the following examples:
|
| |
| |
|
|
| |
|
|
| |
для: mindless
(09.01.2007 в 16:16)
| | | $this - это указатель на сам обьект. | |
| |
|
|
| |
|
|
| |
<?php
class A
{
function foo()
{
if (isset($this)) {
echo '$this is defined (';
echo get_class($this);
echo ")\n";
} else {
echo "\$this is not defined.\n";
}
}
}
|
в данном примере куда ссылается $this?
что мне казалося оно используется при вызове методом и аргументов внутри класса... | |
| |
|
|
|