목록전체 글 (77)
4번독수리의 둥지
foo
on PHP 5.1.6 1. define(FOO, 'bar'); echo FOO; -------- bar 2. function foo() { define(BAR, 'baz'); } foo(); echo BAR; -------- baz 3. $foo = 'bar'; define(BAZ, $foo); unset($foo); echo $foo; echo '--'; echo BAZ; -------- --bar 4. class Foo { public function __construct() { self::bar(); } public static function bar() { define(BAZ, 'quux'); } } $norf = new Foo(); echo BAZ; -------- quux 5. define(..
http://php.net/manual/en/functions.user-defined.php http://stackoverflow.com/a/14753616 The following codes use this feature for setting hex2bin() compartible in a class MyClass on PHP5. class MyClass { public function __construct() { self::compat(); } private static function compat() { if (!function_exists('hex2bin')) { function hex2bin($hexString) { return pack('H*', $hexString); } } } public ..
http://php.net/manual/kr/features.gc.refcounting-basics.php http://php.net/manual/kr/features.gc.collecting-cycles.php http://php.net/manual/kr/features.gc.performance-considerations.php Memory Leaks With Objects in PHP 5 http://paul-m-jones.com/archives/262 http://stackoverflow.com/questions/584960/whats-better-at-freeing-memory-with-php-unset-or-var-null
http://stackoverflow.com/questions/2218937/has-a-is-a-terminology-in-object-oriented-language This is object-oriented programming and UML terminology, not Java-specific. There are actually three cases you should be aware of: A House is a Building (inheritance); A House has a Room (composition); A House has an occupant (aggregation). The difference between (2) and (3) is subtle yet important to d..