Rofihimam

Untitled

Feb 12th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  1. <?php
  2.     interface a
  3.     {
  4.         const b = 'Interfcae constant';
  5.     }
  6.  
  7.     // Prints: Interface constant
  8.     echo a::b;
  9.  
  10.     /**
  11.     This will however not work because it's not allowed to override constant
  12.      */
  13.     class b implements a
  14.     {
  15.         const b = 'Class constant';
  16.     }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment