update : 2015.11.03
php.shukuma.com검색:
|
Extended interfaceThe extended interface provides a small suite of functions that allow the user to define an arbitrary number of named counters with unique settings. The basic interface can be used in parallel with the extended interface. Example #1 "counter"'s extended interface
<?php When run once, the above example outputs: Counter's name is 'one' and is persistent. Its current value is 2. Counter's name is 'two' and is not persistent. Its current value is 5. Not a valid counter! Counter's name is 'four' and is persistent. Its current value is 3. If run a second time within the same instance of PHP, it outputs: Counter's name is 'one' and is persistent. Its current value is 4. Counter's name is 'two' and is not persistent. Its current value is 5. Not a valid counter! Counter's name is 'four' and is persistent. Its current value is 4. If then run a third time in a different instance of PHP, it outputs: Counter's name is 'one' and is persistent. Its current value is 2. Counter's name is 'two' and is not persistent. Its current value is 5. Not a valid counter! Counter's name is 'four' and is persistent. Its current value is 5. |