PHP/JS/MYSQL 测试题

2 篇文章 0 订阅
2 篇文章 0 订阅

每题答案在答案两字下方,白字,拖动鼠标选中显示,或Ctrl+A


1

<?php
$a = '123';
?>
<?php
echo include "1.php";
?>
答案:

1


2

<?php
    $arr = array(1,2,3);
    foreach($arr as &$val) {
        $val += $val % 2 ? $val++ : $val--;
    }
	$val=10;
    print(join('',$arr));
?>

答案:

3310


3

<?php
ini_set('display_errors',0);
$arr = array(1=>1,3=>3);
$i = 2;
$a = 'test' . isset($arr[$i]) ? $arr[$i] : $i;
var_dump($a);
?>
答案:

NULL


4

<script>  

for(var i = 0;i < 5;i++) {
    setTimeout(function(){
       console.log(i);
    },500);
}
</script> 
答案:

5个5


5

<?php
    print (int)pow(2,69);
?>

答案:

0


6

select a.id,b.name from tab1 as a left join tab2 as b on (a.id=b.id) where a.id >10
若出现空值,使用什么命令设置默认值
答案:

NVL


7

<?php
    function timesTwo(&$int) {
        $int = $int * 2;
    }
    $int = 2;
    $result = timesTwo($int);
    var_dump($result);
?>
答案:

NULL


8

SELECT * FROM `table` LIMIT 20,10
在上边sql中使用什么选项可以使 SELECT FOUND_ROWS() 忽略 LIMIT 子句,返回总数?

答案:

SQL_CALC_FOUND_ROWS




9

<script>  
a();
function a(){alert('hello')}
b();
var  b = function() {alert('world')}
</script> 
输出什么
答案:

hello 报错


10

<?php
   echo intval((0.3+0.6)*10);
  echo intval((0.01+0.57)*100);
  echo intval((0.01+0.09)*10);
?>
答案:
9570


11

Integer i1 = 124;
Integer i2 = 124;
Integer i3 = 129;
Integer i4 = 129;
System.out.println(i1 == i2);
System.out.println(i3.equals(i4));
System.out.println(i3 == i4);
答案:
true true false


12

<?php  
    echo -10%3; 
?>
答案:
-1


13

<?php 
$x = 2; 
echo $x == 2 ? '我' : $x == 1 ? '你' : '它'; 
?> 
答案:


14

<?php  
    $count = 5; 
    function get_count() { 
        static $count = 0; 
        return $count++; 
    } 
    ++$count; 
    get_count(); 
    echo get_count(); 
?>
答案:
1


15

<?php
if($a = 100 && $b = 200) {
    var_dump($a,$b);
}
?>
答案:
bool(true)    int(100)


16
<?php
    $i=11;
    printf("%d",printf("%d",printf("%d",$i)));
?>
答案:
1121

17

<?php
$a = 3;
$b = 5;
if($a = 5 || $b = 7) {
    $a++;
    $b++;
}

echo $a . " " . $b;
?>
答案:
1 6


18

<?php
     $a = count ("567")  + count(null) + count(false);
     echo $a;
?>
答案:
2


19

<script type="text/javascript">
var obj = obj1 = {};
obj1['y'] = 3;
obj['x'] = obj1;
obj1['y'] = 4;
alert(obj['x']['y']);
</script>
答案:
4

20

<script type="text/javascript">

var a ;
var b=null;
var c="s";
var d=123;
var e=function(){};

document.write(typeof  a)
document.write("<br />")
document.write(typeof  b)
document.write("<br />")
document.write(typeof  c)
document.write("<br />")
document.write(typeof  d)
document.write("<br />")
document.write(typeof  e)
</script>
答案:

undefined
object
string
number

function


21

<script type="text/javascript">
if(90<=70<=100){
alert("true")
}
</script>
答案:
true


22

<script type="text/javascript">
for(var count=0;;)
if(count<10)
count+=3;
else
alert(count);
</script>
答案:

12

23

<script type="text/javascript">
function test(number){
return function test(number){
return function test(number){
return number
}}}
alert(test(1)(2)(3))
</script>
答案:

3


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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值