Define class constant : Class Constant Property « Class « PHP






Define class constant

<?php

   class math_functions {
     const PI = '3.14159265';
     const E = '2.7182818284';
     const EULER = '0.5772156649';
     /* define other constants and methods here... */
   }

   echo math_functions::PI;

?>

           
       








Related examples in the same category

1.Class Constant
2.Define class level constant value to control the class behaviour