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知識點匯總與解答