Register|Login

Have a question? Click here to ask the community.

Quiz 4 – Variables

| In: PHP Quizzes | 38,078 views

*You are currently not logged in and your quiz score will not be recorded. Please login or register if you would like to submit your quiz score.

Directions: Answer all questions. Any questions skipped will be scored as wrong answers. Good Luck! 🙂

1. Which of the following is the incorrect way to declare a PHP variable?

$aVariable;
$a_Variable = 9;
$AVariable;
$a  Variable;

2. PHP variables need to be declared before adding a value to it?

True
False

3. What data type will PHP automatically convert the following variable to:

$aVariable = “Robert”;

integer (a number variable)
string (a text variable)

4. All variables in PHP start with a $(dollar) sign?

True
False

5. When a variable is declared, it can only be used 1 time in your PHP source file?

True
False

6. PHP variables are case-sensitive?

True
False

7. What data type will PHP automatically convert the following variable to:?

$aVariable = 99;

integer (a number variable)
string (a text variable)

8. Which of the following is the incorrect way to declare a PHP variable?
Hint: All variable declarations should end with a semi-colon.

$a_Number = 9
$a_Number = 9;
$a_Num = 9;
$aNumber = 9;

9. Are the following two variables the same:

$yValue = 7;
$YValue = 7;

Yes
No

10. Are the following two variables the same:

$randomString = “YouTubers”;
$randomString = “Google”;

Yes
No



4 Responses to Quiz 4 – Variables

Avatar

Mohanbabu

April 6th, 2015 at 10:07 am

First i thank the team who had developed this website…..its awesome and one can learn easily from basics…….great job

Avatar

Robert Smith

April 6th, 2015 at 12:38 pm

Glad to hear, thanks for letting us know 🙂

Avatar

joanbritto

August 11th, 2017 at 7:22 am

I really thank you guys.. It helps me a lot

Avatar

Robert Smith

August 17th, 2017 at 10:49 pm

Glad to here it helped you! 🙂

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 1 User

Most Users Ever Online: 91

Quiz Scores

Advertisments