¡@

Home 

php Programming Glossary: my_const

PHP5: const vs static

http://stackoverflow.com/questions/1685922/php5-const-vs-static

10 defaults to public unless otherwise specified const MY_CONST 5 echo ClassName my_var returns 10 echo ClassName MY_CONST returns.. MY_CONST 5 echo ClassName my_var returns 10 echo ClassName MY_CONST returns 5 ClassName my_var 20 now equals 20 ClassName MY_CONST.. returns 5 ClassName my_var 20 now equals 20 ClassName MY_CONST 20 error won't work. Public protected and private are irrelevant..

Accessing a class constant using a simple variable which contains the name of the constant

http://stackoverflow.com/questions/7506530/accessing-a-class-constant-using-a-simple-variable-which-contains-the-name-of-th

to access a class constant in one of my classes const MY_CONST value If I have a variable which holds the name of this constant.. which holds the name of this constant like this myVar MY_CONST Can I access the value of MY_CONST somehow self myVar does not.. like this myVar MY_CONST Can I access the value of MY_CONST somehow self myVar does not work obviously because it is for..