Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjdev/php-ext-enum
Enum interface
https://github.com/kjdev/php-ext-enum
Last synced: 25 days ago
JSON representation
Enum interface
- Host: GitHub
- URL: https://github.com/kjdev/php-ext-enum
- Owner: kjdev
- License: other
- Created: 2012-06-11T08:04:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-06-11T08:04:34.000Z (over 12 years ago)
- Last Synced: 2024-11-18T00:52:38.291Z (about 2 months ago)
- Language: C
- Size: 94.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-ext-enum #
This PHP extension is enum interface.
## Build ##
% phpize
% ./configure
% make
% make install## Configration ##
enum.ini:
extension=enum.so
## Function : enum ##
bool enum( string $name, mixed $constants )
### parameters ###
name:
The interface name
constants:
The constant objects
### return values ###
Returns TRUE if the interface succeeded in creating, FALSE otherwise.
## Function : enum_vars ##
bool enum_vars( mixed $interface )
### parameters ###
name:
An object instance or interface name
### return values ###
An array of constants. Constant name in key, constant value in value.
## Function : enum_exists ##
bool enum_exists( string $name )
### parameters ###
name:
The constant name
### return values ###
Returns TRUE if the named constant given by name has been defined,
FALSE otherwise.## Example ##
enum('Test', array('a', 'b', 'c'));
echo Test::a;
enum_vars('Test');
enum_exists('Test::b');
class Hoge inplements Test {};