Retrieves the value of a class constant, while avoiding the T_PAAMAYIM_NEKUDOTAYIM
error. Misspelled because const
is a reserved word.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
An instance of the class containing the constant. |
|
|
Required |
The name of the constant to retrieve. |
Returns
Type |
Description |
---|---|
The value of the class constant. |
Examples
Very simple example of konst().
$s3 = new AmazonS3(); $rfc2616 = $s3->util->konst($s3->util, 'DATE_FORMAT_RFC2616'); $date = gmdate($rfc2616, 946684800); var_dump($date);Result:
string(29) "Sat, 01 Jan 2000 00:00:00 GMT"
Source
Method defined in utilities/utilities.class.php | Toggle source view (13 lines) | View on GitHub