MemoryRefresh!

Oop / Class constants   Class constants



Questions Answers 0%

Pages   0 from 91
Questions   0 from 142

Reset


Class constants are public, and accessible from all scopes.
<?php class foo { const BAR = "Hello World"; } echo foo::BAR; // output Hello World // --- Look Here --- // Class constants have the same limitations as normal constants.
<?php class foo { const ARR = array(); // Arrays are not allowed in class constants // --- Look Here --- // }
1) Get class constant.




2) Which is incorrect?









Class constants are public, and accessible from all scopes.
<?php class foo { const BAR = "Hello World"; } echo foo::BAR; // output Hello World // --- Look Here --- // Class constants have the same limitations as normal constants.
<?php class foo { const ARR = array(); // Arrays are not allowed in class constants // --- Look Here --- // }

References









Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References