aptitude_PHP Numbers Aptitude问题与解答

aptitude

This section contains Aptitude Questions and Answers on PHP Numbers.

本节包含有关PHP数字的能力问题。

1) PHP supports automatic type conversion?
  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, PHP supports automatic type conversion.

1)PHP是否支持自动类型转换?
  1. 没有

答案与解释

正确答案:1

是的,PHP支持自动类型转换。

2) Which of the following function is used to check a variable contains an integer number?
  1. is_int()

  2. isint()

  3. isinteger()

  4. None of the above

Answer & Explanation

Correct answer: 1
is_int()

The is_int() function is used to check a variable contains an integer number.

2)以下哪个函数用于检查变量是否包含整数?
  1. is_int()

  2. isint()

  3. isinteger()

  4. 以上都不是

答案与解释

正确答案:1
is_int()

is_int()函数用于检查包含整数的变量。

3) What is the correct output of the given code snippets?
<?php
	$num = 1234;
	var_dump(is_integer($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
bool(true)

The above code will print "bool(true)" on the webpage.

3)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
布尔值(true)

上面的代码将在网页上打印“ bool(true)”

4) What is the correct output of the given code snippets?
<?php
    $num = 1234;
    var_dump(is_integer($num));
    
    $num = 12.34;
    var_dump(is_integer($num));
?>  

  1. bool(true)

  2. bool(false)

  3. bool(true) bool(false)

  4. Error

Answer & Explanation

Correct answer: 3
bool(true) bool(false)

The above code will print "bool(true) bool(false)" on the webpage.

4)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. bool(true)bool(false)

  4. 错误

答案与解释

正确答案:3
bool(true)bool(false)

上面的代码将在网页上打印“ bool(true)bool(false)”

5) Which of the following function is not available in PHP?
  1. is_int()

  2. is_integer()

  3. is_long()

  4. is_short()

Answer & Explanation

Correct answer: 4
is_short()

The is_short() function is not available in PHP.

5)以下哪个功能在PHP中不可用?
  1. is_int()

  2. is_integer()

  3. 长()

  4. 是短()

答案与解释

正确答案:4
是短()

is_short()函数在PHP中不可用。

6) Which of the following function is not available in PHP?
  1. is_float()

  2. is_double()

  3. is_longdouble()

  4. is_integer()

Answer & Explanation

Correct answer: 3
is_longdouble()

The is_longdouble() function is not available in PHP.

6)以下哪个功能在PHP中不可用?
  1. is_float()

  2. is_double()

  3. is_longdouble()

  4. is_integer()

答案与解释

正确答案:3
is_longdouble()

is_longdouble()函数在PHP中不可用。

7) What is the correct output of the given code snippets?
<?php
    $num = 12.34;
    var_dump(is_double($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
bool(true)

The above code will print "bool(true)" on the webpage.

7)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
布尔值(true)

上面的代码将在网页上打印“ bool(true)”

8) What is the correct output of the given code snippets?
<?php
    $num = 12.34F;
    var_dump(is_double($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 3
Error

The above code will generate an error.

8)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:3
错误

上面的代码将产生错误。

9) What is the correct output of the given code snippets?
<?php
    $num = 12.34;
    var_dump(is_float($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
bool(true)

The above code will print "bool(true)" on the webpage.

9)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
布尔值(true)

上面的代码将在网页上打印“ bool(true)”

10) The is_float() function is alias of is_double() function in PHP?
<?php
	define("COUNTRIES", ["INDIA","AUSTRALIA","USA"]);
	echo COUNTRY[1];    
?>

  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, the is_float() function is alias of is_double() function in PHP.

10)is_float()函数是PHP中is_double()函数的别名吗?
  1. 没有

答案与解释

正确答案:1

是的, is_float()函数是PHP中is_double()函数的别名。

11) Which of the following functions are used to check numbers infinity in PHP?
  1. is_finite()

  2. is_infinite()

  3. isfinite()

  4. isinfinite()

Options:

  1. Only A

  2. Only B

  3. A and B

  4. C and D

Answer & Explanation

Correct answer: 3
A and B

The is_finite() and is_infinite() functions are used to check numbers infinity in PHP.

11)以下哪个函数用于检查PHP中的数字无穷大?
  1. is_finite()

  2. is_infinite()

  3. isfinite()

  4. isinfinite()

选项:

  1. 只有一个

  2. 只有B

  3. A和B

  4. C和D

答案与解释

正确答案:3
A和B

is_finite()和is_infinite()函数用于检查PHP中的数字无穷大。

12) What is the correct output of the given code snippets?
<?php
    $num = 1234;
    var_dump(is_nan($num));
?>

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 2
bool(false)

The above code will print "bool(false)" on the webpage.

12)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:2
布尔值(false)

上面的代码将在网页上打印“ bool(false)”

13) What is the correct output of the given code snippets?
<?php
    $num = "ABC";
    var_dump(is_numeric($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 2
bool(false)

The above code will print "bool(false)" on the webpage.

13)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:2
布尔值(false)

上面的代码将在网页上打印“ bool(false)”

14) What is the correct output of the given code snippets?
<?php
    $num = "123";
    var_dump(is_numeric($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
bool(true)

The above code will print "bool(true)" on the webpage.

14)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
布尔值(true)

上面的代码将在网页上打印“ bool(true)”

15) What is the correct output of the given code snippets?
<?php
    $num = "123.45";
    var_dump(is_numeric($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
bool(true)

The above code will print "bool(true)" on the webpage.

15)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
布尔值(true)

上面的代码将在网页上打印“ bool(true)”

16) Which of the following are used for type conversion in PHP?
  1. int

  2. integer

  3. intval

  4. int_val

Options:

  1. A and B

  2. A and C

  3. A, B, and C

  4. A, B, C, and D

Answer & Explanation

Correct answer: 3
A, B, and C

The int, integer, and intval are used for type conversion in PHP.

16)以下哪项用于PHP中的类型转换?
  1. 整型

  2. 整数

  3. 间隔

  4. int_val

选项:

  1. A和B

  2. A和C

  3. A,B和C

  4. A,B,C和D

答案与解释

正确答案:3
A,B和C

int , integer和intval用于PHP中的类型转换。

17) What is the correct output of the given code snippets?
<?php
    $num1 = "123";    
    $num2 = int($num1);
    echo $num2;    
?>  

  1. 123

  2. "123"

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 3
Error

The above code will generate a syntax error.

17)给定代码段的正确输出是什么?
  1. 123

  2. “ 123”

  3. 错误

  4. 以上都不是

答案与解释

正确答案:3
错误

上面的代码将生成语法错误。

18) What is the correct output of the given code snippets?
<?php
    $num1 = "123";
    
    $num2 = intval($num1);
    
    echo $num2;
?>  

  1. 123

  2. "123"

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
123

The above code will print "123" on the webpage.

18)给定代码段的正确输出是什么?
  1. 123

  2. “ 123”

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
123

上面的代码将在网页上打印“ 123”。

19) What is the correct output of the given code snippets?
<?php
    $num1 = "123";
    
    $num2 = integer($num1);
    
    echo $num2;
?>  

  1. 123

  2. "123"

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 3
Error

The above code will generate a syntax error.

19)给定代码段的正确输出是什么?
  1. 123

  2. “ 123”

  3. 错误

  4. 以上都不是

答案与解释

正确答案:3
错误

上面的代码将生成语法错误。

20) What is the correct output of the given code snippets?
<?php
    $num1 = "123";
    
    $num2 = (integer)$num1;
    
    echo $num2;
?>  

  1. 123

  2. "123"

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
123

The above code will print "123" on the webpage.

20)给定代码段的正确输出是什么?
  1. 123

  2. “ 123”

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
123

上面的代码将在网页上打印“ 123”

21) What is the correct output of the given code snippets?
<?php
    $num1 = "ABC";
    
    $num2 = (int)$num1;
    
    echo $num2;
?>

  1. 123

  2. 0

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 2
0

The above code will print "0" on the webpage.

21)给定代码段的正确输出是什么?
  1. 123

  2. 0

  3. 错误

  4. 以上都不是

答案与解释

正确答案:2
0

上面的代码将在网页上打印“ 0”

22) What is the correct output of the given code snippets?
<?php
    $num1 = "ABC";
    
    $num2 = intval($num1);
    
    echo $num2;
?>  

  1. 123

  2. 0

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 2
0

The above code will print "0" on the webpage.

22)给定代码段的正确输出是什么?
  1. 123

  2. 0

  3. 错误

  4. 以上都不是

答案与解释

正确答案:2
0

上面的代码将在网页上打印“ 0”

23) What is the correct output of the given code snippets?
<?php
    $num = "123" + 45;
    
    var_dump(isnumeric($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 3
Error

The above code will generate a syntax error.

23)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:3
错误

上面的代码将生成语法错误。

24) What is the correct output of the given code snippets?
<?php
    $num = "123" + 45;
    
    var_dump(is_numeric($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 1
bool(true)

The above code will print "bool(true)" on the webpage.

24)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:1
布尔值(true)

上面的代码将在网页上打印“ bool(true)”

25) What is the correct output of the given code snippets?
<?php
    $num = "ABC";
    
    var_dump(is_nan($num));
?>  

  1. bool(true)

  2. bool(false)

  3. Error

  4. None of the above

Answer & Explanation

Correct answer: 4
None of the above

The above code will print "NULL" on the webpage.

25)给定代码段的正确输出是什么?
  1. 布尔值(true)

  2. 布尔值(false)

  3. 错误

  4. 以上都不是

答案与解释

正确答案:4
以上都不是

上面的代码将在网页上显示“ NULL”

翻译自: https://www.includehelp.com/php/numbers-aptitude-questions-and-answers.aspx

aptitude

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值