Class Constant : Class Constant Property « Class « PHP






Class Constant


<?php
class Employee {
    const AVAILABLE      = 0;
    const OUT_OF_STOCK   = 1;
    public $status;
}
print Employee::AVAILABLE;
?>

           
       








Related examples in the same category

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