![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 90 Pomógł: 0 Dołączył: 3.04.2003 Skąd: Opole Ostrzeżenie: (0%) ![]() ![]() |
Otoz jest taki kawalek kodu php:
[php:1:28e0ae4307] <?php class Test { function &factory() { return new Test; } function &singleton() { static $instance; if (!isset($instance)) { $instance =& Test::factory(); } return $instance; } } $Test1 =& Test::singleton(); $Test1->aaa = 1; $Test2 =& Test::singleton(); print_r($Test1); print_r('<br>'); print_r($Test2); ?> [/php:1:28e0ae4307] i wyswietla on: Kod test Object ( [aaa] => 1 )
test Object ( ) Dlaczego ? -------------------- code.gosu.pl
|
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 15.08.2025 - 17:41 |