php知识点汇总与解答
This section contains Aptitude Questions and Answers on PHP Operators.
本节包含有关PHP运算符的 Aptitude问答。
Arithmetic Operators
Logical Operators
Array Operators
String Operators
Options:
A and B
C and D
A, B, and C
A, B, C, and D
Correct answer: 4
A, B, C, and D
All given options are correct types of operators are used in PHP.
算术运算符
逻辑运算符
数组运算符
字符串运算符
选项:
A和B
C和D
A,B和C
A,B,C和D
正确答案:4
A,B,C和D
所有给定的选项都是PHP中使用的正确运算符类型。
<?php
$NUM1 = 3;
$NUM2 = 4;
$NUM3 = $NUM1 ** $NUM2;
echo $NUM3;
?>
12
81
Garbage value
None of the above
Correct answer: 2
81
The above code will print "81" on the webpage. Because ** operator is used for exponential.
12
81
垃圾价值
以上都不是
正确答案:2
81
上面的代码将在网页上打印“ 81” 。 因为**运算符用于指数。
Arithmetic operator
Logical operator
Comparison operator
Conditional operator
Correct answer: 1
Arithmetic operator
The ** operator belongs to arithmetic operators.
算术运算符
逻辑运算符
比较运算符
条件运算符
正确答案:1
算术运算符
**运算符属于算术运算符。
==
!=
===
< = >
Options:
A and B
C and D
A, B, and C
A, B, C, and D
Correct answer: 4
A, B, C, and D
All the given options are comparison operators.
==
!=
===
<=>
选项:
A和B
C和D
A,B和C
A,B,C和D
正确答案:4
A,B,C和D
所有给定的选项都是比较运算符。
<?php
$NUM1 = 3;
$NUM2 = 4;
var_dump($NUM1<>$NUM2);
?>
bool(true)
bool(false)
Error
None of the above
Correct answer: 1
bool(true)
The above code will print bool(true) on the webpage, the <> operator is "not equal to" operator.
布尔值(true)
布尔值(false)
错误
以上都不是
正确答案:1
布尔值(true)
上面的代码将在网页上打印bool(true) , <>运算符为“不等于”运算符。
<?php
$NUM1 = 3;
$NUM2 = 4;
var_dump($NUM1!==$NUM2);
?>
bool(true)
bool(false)
Error
None of the above
Correct answer: 1
bool(true)
The above code will print bool(true) on the webpage.
布尔值(true)
布尔值(false)
错误
以上都不是
正确答案:1
布尔值(true)
上面的代码将在网页上打印bool(true) 。
<?php
$NUM1 = 3;
$NUM2 = 4;
var_dump($NUM1<=>$NUM2);
?>
int(0)
int(-1)
int(1)
Error
Correct answer: 2
int(-1)
The above code will print "int(-1)" on the webpage.
整数(0)
整数(-1)
整数(1)
错误
正确答案:2
整数(-1)
上面的代码将在网页上打印“ int(-1)” 。
<?php
$num = "Hello";
var_dump($num);
?>
Dot (.)
=
.=
@
Correct answer: 4
@
The @ operator is not available in PHP.
点(。)
=
。=
@
正确答案:4
@
@运算符在PHP中不可用。
<?php
echo $country = $country ?? "india";
?>
india
garbage value
Error
None of the above
Correct answer: 1
india
The above code will print the "india" on the webpage.
印度
垃圾价值
错误
以上都不是
正确答案:1
印度
上面的代码将在网页上打印“印度” 。
< == >
===
??
?
Correct answer: 3
??
The ?? operator is known as the null coalescing operator in PHP.
<==>
===
??
?
正确答案:3
??
?? 运算符在PHP中被称为空合并运算符。
翻译自: https://www.includehelp.com/php/operators-aptitude-questions-and-answers.aspx
php知识点汇总与解答