doc:todo:undocumented
Differences
This shows you the differences between two versions of the page.
doc:todo:undocumented [2008/09/12 14:10] kalle upd |
doc:todo:undocumented [2017/09/22 13:28] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Undocumented stuff ====== | ||
- | Feel free to document anything presented here. Entries linking to user notes have not been confirmed, so may or may not need documentations (or demonstrate real bugs) but they are worth exploring. | ||
- | |||
- | ===== PHP 6 ===== | ||
- | |||
- | * Binary and unicode string | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | $unicode = ' | ||
- | $binary | ||
- | $binary2 = (binary) $unicode; | ||
- | $binary3 = b<<< | ||
- | 傀傂两亨乄了乆刄 | ||
- | FOO; | ||
- | |||
- | echo strlen($unicode); | ||
- | echo strlen($binary); | ||
- | echo strlen($binary2); | ||
- | echo strlen($binary3); | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * Unicode escapes | ||
- | <code php> | ||
- | <? | ||
- | |||
- | // ' | ||
- | $str = ' | ||
- | // ' | ||
- | $str = ' | ||
- | // unicode(8) " | ||
- | var_dump($str); | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * Normalization | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | $GLOBALS[" | ||
- | // U+00C5 = Å | ||
- | echo $GLOBALS[" | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * Session: Added ability to provide upload progress feedback through session data. See [[rfc: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===== PHP 5.3 ===== | ||
- | * SPL classes: ArrayObject, | ||
- | |||
- | * '' | ||
- | <code php> | ||
- | <? | ||
- | |||
- | goto a; | ||
- | print ' | ||
- | |||
- | a: | ||
- | print ' | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * ''?:'' | ||
- | <code php> | ||
- | <? | ||
- | |||
- | var_dump(0 ?: ' | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * '' | ||
- | <code php> | ||
- | <? | ||
- | |||
- | namespace foo::bar; | ||
- | |||
- | const bar = 2; | ||
- | |||
- | function foo() { | ||
- | return ' | ||
- | } | ||
- | |||
- | var_dump(namespace:: | ||
- | /* | ||
- | int(2) | ||
- | string(4) " | ||
- | */ | ||
- | ?> | ||
- | </ | ||
- | |||
- | * Override existing classes | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | namespace test; | ||
- | |||
- | class foo { } | ||
- | |||
- | use test::foo as stdClass; | ||
- | |||
- | var_dump(new stdClass); | ||
- | /* | ||
- | object(test:: | ||
- | } | ||
- | */ | ||
- | ?> | ||
- | </ | ||
- | |||
- | * '' | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | class bar { | ||
- | public function show() { | ||
- | var_dump(new static); | ||
- | } | ||
- | } | ||
- | |||
- | class foo extends bar { | ||
- | public function test() { | ||
- | parent:: | ||
- | } | ||
- | } | ||
- | |||
- | $foo = new foo; | ||
- | $foo-> | ||
- | $foo:: | ||
- | /* | ||
- | object(foo)# | ||
- | } | ||
- | object(bar)# | ||
- | } | ||
- | */ | ||
- | ?> | ||
- | </ | ||
- | |||
- | * '' | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | class foo { } | ||
- | class_alias(' | ||
- | |||
- | var_dump(new bar); | ||
- | /* | ||
- | object(foo)# | ||
- | } | ||
- | */ | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * Heredoc with double quotes | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | print <<<" | ||
- | Foobar! :) | ||
- | FOO; | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * user_ini.filename user-initialization mechanism and config variables: | ||
- | user_ini.filename and user_ini.cache_ttl. | ||
- | |||
- | * [HOST=] and [PATH=] configuration sections in php.ini | ||
- | |||
- | * '' | ||
- | |||
- | * zend_parse_parameters types: C, f, Z, h | ||
- | |||
- | * '' | ||
- | |||
- | ===== PHP 5.x ==== | ||
- | |||
- | * Type hints: '' | ||
- | <code php> | ||
- | <? | ||
- | |||
- | interface iTest { } | ||
- | |||
- | class baz implements iTest {} | ||
- | |||
- | class bar { } | ||
- | |||
- | class foo extends bar { | ||
- | public function testFoo(self $obj) { | ||
- | var_dump($obj); | ||
- | } | ||
- | public function testBar(parent $obj) { | ||
- | var_dump($obj); | ||
- | } | ||
- | public function testBaz(iTest $obj) { | ||
- | var_dump($obj); | ||
- | } | ||
- | } | ||
- | |||
- | $foo = new foo; | ||
- | $foo-> | ||
- | $foo-> | ||
- | $foo-> | ||
- | $foo-> | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * " | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | $foo = new stdClass; | ||
- | |||
- | $foo-> | ||
- | |||
- | var_dump($foo); | ||
- | /* | ||
- | object(stdClass)# | ||
- | [" | ||
- | string(4) " | ||
- | } | ||
- | */ | ||
- | ?> | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | ===== Others ===== | ||
- | |||
- | * Trick for access private properties. ([[http:// | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | class foo { | ||
- | private $bar = 42; | ||
- | |||
- | } | ||
- | |||
- | $obj = new foo; | ||
- | $propname=" | ||
- | $a = (array) $obj; | ||
- | echo $a[$propname]; | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | * Its possible to use type casting after another type cast | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | class ToString | ||
- | { | ||
- | public function __toString() | ||
- | { | ||
- | return " | ||
- | } | ||
- | } | ||
- | |||
- | var_dump((int) (string) new ToString); | ||
- | ?> | ||
- | </ | ||
- | |||
- | * Casting an object to an array and back to an object changes the class to stdClass | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | class Test | ||
- | { | ||
- | private $test; | ||
- | } | ||
- | |||
- | var_dump((object) (array) new Test); | ||
- | ?> | ||
- | </ | ||
- | |||
- | * '' | ||
- | <code php> | ||
- | <?php | ||
- | |||
- | function test(& | ||
- | |||
- | $arr = array(); | ||
- | test($arr[]); | ||
- | |||
- | ?> | ||
- | </ | ||
- | |||
- | ===== Add example ===== | ||
- | |||
- | * // | ||
- | * // | ||
- | * // | ||
- | |||
- | |||
- | ===== Add Reference ===== | ||
- | |||
- | * '' | ||
- | * '' | ||
- | |||
- | |||
- | |||
- | ===== Add Related Functions ("See also") ===== | ||
- | |||
- | |||
- | |||
- | ===== User Requests ===== | ||
- | |||
- | ===== Add INSTALL Information ===== | ||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * //filter//: No longer (really) in PECL, so clarify this. | ||
- | |||
- | * // | ||
- | |||
- | |||
- | ===== Errors/ | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * // | ||
- | |||
- | * //tokens//: " | ||
- | |||
doc/todo/undocumented.txt · Last modified: 2017/09/22 13:28 (external edit)