PHP ZCE mock test, interview preparation, daily lessons under chalk talk

Thursday, January 12, 2012

ZCE Zend Certified Engineer Valid Variables

View the Complete Blog on ZCE


Which of the following are valid PHP variables?


1. @$foo
2. &$variable
3. ${0x0}
4. $variable
5. $0x0




Solution: 1,2,3,4
1. @ is used to suppress the error and is completely valid to use in front of a variable.
2. & is a reference variable
3. {} ie the Curly braces are used inside the double quotes in order to avoid variable names conflict. 
4. We all know, its valid
5. Variable name can not begin with a number.





No comments:

Post a Comment