Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. // Example 1.
  2. final $data = true;
  3.  
  4. if (is_final($data)) {
  5.     // It doesn't make sense, because I know that $data is final.
  6. }
  7.  
  8. // Example 2.
  9. class AnotherPackageClass {
  10.     final public $data;
  11. }
  12.  
  13. $reflection = new ReflectionProperty(AnotherPackageClass::class, 'data');
  14. echo $reflection->isFinal(); // true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement