Created
December 22, 2021 15:17
-
-
Save ismail1432/8e601baf15ad9d4aa3ec75510f648780 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Domain; | |
final class Status | |
{ | |
public const DELETED = 'deleted'; | |
public function getDeletedStatus(): string | |
{ | |
return self::DELETED; | |
} | |
} | |
// access from FQCN | |
echo Status::DELETED; // output deleted | |
$status = new Status; | |
// access from instance | |
echo $status::DELETED; // output deleted | |
// access from the class itself | |
echo $status->getDeletedStatus(); // output deleted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment