PHP开发工程师笔试(六)

时长:60分钟 总分:100分

248浏览 1人已完成答题

题型介绍
题型 单选题 简答题
数量 15 2
PHP开发工程师笔试(六)
1.
阅读下面PHP代码,并选择输出结果( ) <?php class A{ public $num=100; } $a = new A(); $b = $a; $a->num=200; echo $b->num; ?>
问题详情




2.
阅读下面PHP代码,并选择输出结果( ) <?php class A{ public static $num=0; public function __construct(){ self::$num++; } } new A(); new A(); new A(); echo A::$num; ?>
问题详情




3.
在PHP面向对象中,下面关于final修饰符描述错误的是( )
问题详情




4.
下列代码输出内容是( ) <?php class A{ public function __construct(){ echo "Class A...<br/>"; } } class B extends A{ public function __construct(){ echo "Class B...<br/>"; } } new B(); ?>
问题详情




5.
哪一个三元运算符相当于此脚本( ) <?php if ($a<10){ if($b>11){ if($c==10&& $d != $c) { $x=0; }else { $x=1; } } } ?>
问题详情




6.
以下代码返回的结果为:( ) function p() { return 1; } if (p()) { echo "false"; } else { echo "true"; }
问题详情




7.
以下程序运行结果:( ) <? $str = “LAMP”; $str1 = “LAMPBrother”; $strc = strcmp($str,$str1); switch ($strc){ case 1: echo“str > str1”; break; case –1: echo“str < str1”; break; case 0: echo“str=str1”; break; default: echo“str <> str1”; } ?>
问题详情




8.
以下程序运行结果为:( ) <?php $var = FALSE; if (empty($var)){ echo"null"; }else{ echo"have value"; } ?>
问题详情




9.
$a="hello"; $b= &$a; unset($b); $b="world"; echo $a; 的结果是什么?( )
问题详情




10.
设有一个数据库mydb中有一个表tb1,表中有六个字段,主键为ID,有十条记录,ID从0到9,以下代码输出结果是? ( ) <?php $link = mysql_connect("localhost","mysql_user", "mysql_password") ordie("Could not connect: " . mysql_error()); $result = mysql_query("SELECT id,name,age FROM mydb、tb1 where id < 5"); ordie("Could not query: . mysql_error()); echo mysql_num_fields($result); mysql_close($link); ?>
问题详情




11.
假设你有一个名为'index.php'的文件的路径为c:/apache/htdocs/phptutor/index.php,那么basename($_SERVER['PHP_SELF'])的返回值为?
问题详情




12.
以下代码的输出为? <?php $arr = array(5 => 1, 12 => 2); $arr[] = 56; $arr["x"] = 42; unset($arr); echo var_dump($arr); ?>
问题详情




13.
下列代码的输出是 <?php $x=dir("."); while($y=$x->read()) { echo $y; } $x->close(); ?>
问题详情




14.
<? php $x="display"; ${$x.'_result'} (); ?> 以上代码将会调用display_result()
问题详情




15.
比较两个string最好用什么方法
问题详情




16.
如何实现字符串翻转?
问题详情
17.
使用哪些工具进行版本控制?
问题详情