constant defined by function define()
index.php:
define('CONSTANT' , 'CONSTANT STRING' );
constant defined by keyword const
foo.php:
const CONSTANT = 'CONSTANT STRING' ;
bar.php:
namespace Foo ;
const CONSTANT = 'CONSTANT STRING' ;
variable in main function
index.php:
$ foo = $ bar ;
$ bar = $ baz ;
$ baz = $ qux ;
variable in global function
foo.php:
function foo() {
$ foo = $ bar ;
$ bar = $ baz ;
$ baz = $ qux ;
}
foo.php:
class Foo {
function bar () {
$ foo = $ bar ;
$ bar = $ baz ;
$ baz = $ qux ;
}
}
variable in closure function
foo.php:
$ foo = function () {
$ foo = $ bar ;
$ bar = $ baz ;
$ baz = $ qux ;
}
variable in comment
foo.php:
/** @var string $foo */
/** @var $foo string */
/** @var \Foo\Bar $bar */
/** @var $bar \Foo\Bar */
variable in function parameters
foo.php:
function foo($ bar ) {
$ baz = $ bar ;
$ qux = $ baz ;
}
variable in function document comment
foo.php:
/**
* @param \Foo\Bar $bar
* @return \stdClass
*/
function foo($ bar ) {
return new \stdClass();
}
variable in method parameters
foo.php:
class Foo {
function bar (\Foo \Bar $ baz ) {
$ qux = $ baz ;
}
}
variable in method document comment
foo.php:
class Foo {
/**
* @param \Foo\Bar $bar
* @return \Foo\Bar
*/
function foo ($ bar ) {
$ baz = $ bar ;
return $ baz ;
}
}
variable in closure function parameters
foo.php:
$ foo = function (\Foo \Bar $ bar ) {
$ baz = $ bar ;
return $ baz ;
}
variable in closure function use parameters
foo.php:
$ foo = function () use (\Foo \Bar $ bar ) {
$ baz = $ bar ;
return $ baz ;
}
foo.php:
function foo() {
}
foo();
foo.php:
/**
* @param \Foo\Bar $bar
* @return \Foo\Bar
*/
function foo($ bar ) {
return new \Foo \Bar ();
}
foo.php:
interface Foo {
}
foo.php:
class Foo {
function bar () {
}
}
$ foo = new Foo ();
$ foo ->bar ();
method defined by class document comment
foo.php:
/**
* Class Foo.
*
* @method bar(string $baz)
*/
class Foo
{
}
$ foo = new Foo ();
$ foo ->bar ('bar' );
method defined by parent class
foo.php:
class Foo {
public function foo () {
}
}
class Bar extends Foo {
}
$ bar = new Bar ();
$ bar ->foo ();
method defined by parent class document comment
foo.php:
/**
* Class Foo.
*
* @method foo(string $foo)
*/
class Foo
{
}
class Bar extends Foo {
}
$ bar = new Bar ();
$ bar ->foo ('foo' );
method call by class::method()
foo.php:
class Foo () {
static function foo () {
}
}
Foo ::foo ();
method call by self::method()
foo.php:
class Foo () {
static function foo () {
}
static function bar () {
self ::foo ();
}
}
Foo ::bar ();
method call by static::method()
foo.php:
class Foo () {
static function foo () {
}
static function bar () {
static ::foo ();
}
}
Foo ::bar ();
method call by parent::method()
foo.php:
class Foo () {
static function foo () {
}
}
class Bar extends Foo {
}
Bar ::foo ();
method call by $this->method()
foo.php:
class Foo {
public function foo () {
}
public function bar () {
$ this ->foo ();
}
}
$ foo = new Foo ();
$ foo ->bar ();
method call by (new Class())->method()
foo.php:
class Foo {
public function foo () {
}
}
$ foo = new Foo ();
$ bar = $ foo ;
$ bar ->foo ();
method call by anonymous class
foo.php:
$ foo = new class {
function foo () {
}
}
$ foo ->foo ();
method call by function returns
foo.php:
function foo() {
return new Bar ();
}
class Bar {
function bar () {
}
}
$ foo = foo();
$ foo ->bar ();
foo()->bar ();
method call by other method returns
foo.php:
class Foo {
function foo () {
return new Bar ();
}
}
class Bar {
function bar () {
}
}
$ foo = new Foo ();
$ foo ->foo ()->bar ();
foo.php:
class Foo {
const Bar = 0 ;
}
echo Foo ::Bar ;
class const property defined by document comment
class variable property defined by document comment
class static variable property
class static variable property defined by document comment