PHP/JS/MYSQL 测试题

来源:互联网 发布:直接淘宝代购找衣服 编辑:程序博客网 时间:2024/06/14 13:19

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


1

<?php$a = '123';?><?phpecho 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

<?phpini_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

<?phpif($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;elsealert(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
原创粉丝点击