PHP interview questions and answers article for php scalar datatype Boolean (TRUE/FALSE). This PHP Online Quiz is a great way to prepare for PHP certificate exam.

This online PHP test include 10 Multi Choice questions related to PHP Booleans.

How many primitive data type does PHP support?
4
6
8
2

Correct!

Wrong!

Which of these are scalar primitive data type in PHP?

<div class="question_list_op">
<ul>
<li>Boolean</li>
<li>Integer</li>
<li>Float</li>
<li>String</li>
<li>Array</li>
<li>Object</li>
</ul>
</div>
1,2,4
1,4,5
4,6
3,6
1,2,5,6
1,2,3,4

Correct!

Wrong!

Which of these are compound primitive data type in PHP?

<div class="question_list_op">
<ul>
<li>Boolean</li>
<li>Integer</li>
<li>Resource</li>
<li>String</li>
<li>Array</li>
<li>Object</li>
</ul>
</div>

 
1,2,3
3,4,5
1,3,6
4,6
5,6
2,4

Correct!

Wrong!

Which of these are special primitive data type in PHP?

<div class="question_list_op">
<ul>
<li>NULL</li>
<li>Integer</li>
<li>Resource</li>
<li>String</li>
<li>Array</li>
<li>Object</li>
</ul>
</div>
1,3
2,3
2,4,5
1,6
4,6
5,6

Correct!

Wrong!

True or False: Variable of Data type is decided at runtime by PHP depending on the context in which that variable is created/used.
True
False

Correct!

Wrong!

Which of the function is not used to get variable data type or check variable data type?
isset()
is_int()
gettype()
var_dump()

Correct!

Wrong!

Which function is used to convert any variable data type?
isset()
settype()
gettype()
None of Above

Correct!

Wrong!

When converting to Boolean, which of the below value(s) are considered as FALSE?

<div class="question_list_op">
<ul>
<li>1</li>
<li>NULL</li>
<li>"0"</li>
<li>array()</li>
<li>"false"</li>
<li>FALSE</li>
<li>""</li>
</ul>
</div>
1,5,7,6
2,3,5,1
7,1,4,5
2,3,4,6,7

Correct!

Wrong!

When converting to Boolean, which of the below value(s) are considered as TRUE?

<div class="question_list_op">
<ul>
<li>1</li>
<li>-50</li>
<li>"WEBMULL"</li>
<li>array('company'=>"webmull")</li>
<li>"false"</li>
<li>FALSE</li>
<li>""</li>
</ul>
</div>
1,2,3,4,5
4,5,6,7
3,4,5,6,7
4,7

Correct!

Wrong!

What is output of below code:

<div class="question_list_op"> var_dump((bool) "false"); </div>
Bool (False)
Bool (True)

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

PHP Interview Questions – Datatype: Boolean

I got %%score%% of %%total%% right

%%description%%

%%description%%

Loading...