rfc:returntypehint
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:returntypehint [2010/07/28 19:38] – change the title felipe | rfc:returntypehint [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 33: | Line 33: | ||
PHP Catchable fatal error: | PHP Catchable fatal error: | ||
called in ... on line 9 and returning in ... on line 4 | called in ... on line 9 and returning in ... on line 4 | ||
+ | */ | ||
+ | </ | ||
+ | |||
+ | === Using an user class type === | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | class Bar { } | ||
+ | |||
+ | class Foo extends Bar { | ||
+ | public function Bar test($x) { | ||
+ | return $x; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $foo = new Foo; | ||
+ | $foo-> | ||
+ | $foo-> | ||
+ | /* | ||
+ | PHP Catchable fatal error: | ||
+ | called in ... on line 13 and returning in ... on line 7 | ||
*/ | */ | ||
</ | </ | ||
Line 50: | Line 72: | ||
} | } | ||
// PHP Fatal error: | // PHP Fatal error: | ||
+ | </ | ||
+ | |||
+ | === Using a namespaced class === | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | namespace foo { | ||
+ | class foo { } | ||
+ | class bar extends foo { } | ||
+ | } | ||
+ | |||
+ | namespace bar { | ||
+ | class bar { | ||
+ | public function \foo\foo test() { | ||
+ | return new \foo\bar; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $bar = new bar; | ||
+ | $bar-> | ||
+ | } | ||
</ | </ | ||
Line 72: | Line 116: | ||
$func = new ReflectionMethod(' | $func = new ReflectionMethod(' | ||
- | var_dump($func-> | + | var_dump($func-> |
- | var_dump($func-> | + | var_dump($func-> |
- | var_dump($func-> | + | |
</ | </ | ||
Line 87: | Line 130: | ||
$func = new ReflectionFunction(' | $func = new ReflectionFunction(' | ||
- | var_dump($func-> | + | var_dump($func-> |
+ | var_dump($func-> | ||
</ | </ | ||
+ | === Using " | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | class foo { | ||
+ | function self bar() { | ||
+ | return new foo; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $func = new ReflectionMethod(' | ||
+ | var_dump($func-> | ||
+ | var_dump($func-> | ||
+ | </ | ||
===== Patch ===== | ===== Patch ===== | ||
- | Comming soon | + | * Engine + Reflection: http:// |
+ | * Tests: http:// |
rfc/returntypehint.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1