ImageVerifierCode 换一换
格式:DOCX , 页数:82 ,大小:68.37KB ,
资源ID:23867521      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/23867521.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Zend认证试题.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Zend认证试题.docx

1、Zend认证试题Zend认证试题第一章(PHP Programming Basics)ZendChina官方:最重要的是要您要掌握好基础知识。这些知识是需要您一直去关注和学习的,因为它们是学习PHP语言的根基。考试中您没有准备到的部分也可能是您日常程序开发中不会接触到的知识,但是本章中的问题还是需要得到您的重视,毕竟,如果您对最基本知识了解不够,对于您更深入的学习和开发也会带来诸多不便。1、Choose the selection that best matches the following statements:PHP is a _ scripting language based on

2、the _ engine. It is primarily used to develop dynamic_ content, although it can be used to generate _ documents(among others) as well.A.Dynamic, PHP, Database, HTMLB.Embedded, Zend, HTML, XMLC.Perl-based, PHP, Web, StaticD.Embedded, Zend, Docbook, MySQLE.Zend-based, PHP, Image, HTML2、Which of the fo

3、llowing tags is not a valid way to begin and end a PHP code block?A.B.C.D.E.3、Which of the following is not valid PHP code?A.$_10B.$“MyVar”C.&$somethingD.$10_somethingsE.$aVaR4、What is displayed when the following script is executed?A.The value is: DogB.The value is: CatC.The value is: HumanD.The va

4、lue is: 10E.Dog5、What is the difference between print() and echo()?A.print() can be used as part of an expression, while echo() cantB.echo() can be used as part of an expression, while print() cantC.echo() can be used in the CLI version of PHP, while print() cantD.print() can be used in the CLI vers

5、ion of PHP, while echo() cantE.Theres no difference: both functions print out some text!6、What is the output of the following script?A. 128B. 42C. 242.0D. 256E. 3427、Which values should be assigned to the variables $a, $b and $c in order for the following script to display the string Hello, World!?A

6、. False, True, FalseB. True, True, FalseC. False, True, TrueD. False, False, TrueE. True, True, True8、What will the following script output?A. A string of 50 random charactersB. A string of 49 copies of the same character, because the random number generator has not beeninitializedC. A string of 49

7、random charactersD. Nothing, because $array is not an arrayE. A string of 49 G characters9、Which language construct can best represent the following series of if conditionals?A. A switch statement without a default caseB. A recursive function callC. A while statementD. It is the only representation

8、of this logicE. A switch statement using a default case10、What is the best way to iterate through the $myarray array, assuming you want to modify the value of each element as you do?A. Using a for loopB. Using a foreach loopC. Using a while loopD. Using a dowhile loopE. There is no way to accomplish

9、 this goal11、Consider the following segment of code:What should go in the marked segment to produce the following array output?A. foreach($result as $key = $val)B. while($idx *= 2)C. for($idx = 1; $idx = $idx; $idx = 0)E. while($idx = 2;C. $a = 2;D. $a += $a + $a;E. None of the above20、How can a scr

10、ipt come to a clean termination?A. When exit() is calledB. When the execution reaches the end of the current fileC. When PHP crashesD. When Apache terminates because of a system problem答案附在下面,方便大家参考。答案详解1唯一有意义的答案是B。PHP是一种基于Zend引擎的脚本语言,它通常被嵌入在HTML代码中。它主要被用来开发HTML文档,但是也可以用它来开发其他类型的文档,比如XML。2PHP编程中,人们不

11、太使用和两个标签,但它们确实是合法的PHP界定符。标签是非法的,因此正确的答案是D。记住,根据php.ini文件中的配置不同,这当中的某些标签无法在特定的情况下使用。3PHP变量以一个美元符号为开头,后面跟上任意数量的数字、字母和下划线。$“MyVar”是一个合法的变量名,它使用的是较松散的命名约定。&$something是对$something的引用。然而,变量名不能以数字为开头,$10_somethings是非法的,因此答案是D。4注意,$myarray的键值并没有打上引号。所以,正在访问的键不是myvalue字符串,而是常量myvalue的值。最终访问的是$myarray10,值是Dog

12、,答案是A。5尽管print()和echo()在绝大多数情况下可以互换使用,但它们之间还是有一处不同。print()是函数,有返回值;echo()实际上是一个语言结构,没有返回值,并且不能在表达式中使用。因此,答案是A。6%运算符表示取模,它返回两个操作数相除的余数。是左移运算符,相当于乘以2的N次方。最后的答案乘以了一个浮点数,改变了它的数据类型。但是,由于小数点后是零,因此输出的结果不包含小数部分。答案是256(D)。7根据条件式的逻辑,要想得到Hello, World!字符串,必须要在第一个if结构中满足else的条件。因此$a必须为False,然后$b也必须为False。最内层的条件语

13、句的实现要求先前的两个变量($a和$b)是False,而$c必须是True(答案是D)。8正确答案是C。从PHP4.2.0开始,除非已经给定了一个伪随机整数列,否则不再需要用srand()函数初始化随机数生成器。此外,即使随机数生成器没有被事先播种,脚本仍然会生成49个伪随机字符。尽管$array变量是字符串,但可以用访问数组的方式进行访问使用数字索引访问某个位置上的字符。最后,for循环将从1开始执行到50,也就是执行了49次。9用一系列的ifelse语句来检查一个条件的代码块,最适合用switch语句来替代。 复制PHP内容到剪贴板 PHP代码:因为if语句中有一个捕捉所有其他条件的els

14、e,对应的,switch代码块需要一个default。正确答案是E。10通常情况下,foreach语句是遍历数组的首选。但是,由于foreach语句是在数组的副本上进行操作,而我们需要给数组中每个元素重新赋值,所以在这里foreach就不适用了。尽管也可以用while循环和dowhile循环,但由于数组是顺序索引的,最合适的语句还是for语句。因此答案是A。11由于题目只允许填写一行代码,唯一合适的是for循环,因此答案只能是C或者D。要选出能生成正确结果的for循环,我们必须先复习一下for循环的构成要素。PHP中,for循环是这样声明的:for(;)在循环开始时执行一次,然后for循环开始

15、执行大括号内的代码,直到的值为False。每完成一次循环,执行一次。因此,正确的代码块应该是:for ($idx = 1; $idx STOP_AT; $idx *= 2)答案是C。125个选项中,只有两个是合法的PHP函数声明(A和D)。在这两个选项中,只有一个设置了参数的默认值答案是A。13本题考察PHP中变量作用域的相关知识。你必须明确global关键字是如何将变量引入本地域的,以及$_GET、$_POST、$_COOKIE、$_REQUEST等超级全局变量的作用域。本题中,最终的数学表达式是5+25-25-10,等于-5,答案是B。14函数能被以一个包含着函数名的变量后面加上括号(以及

16、必要的参数)的形式动态调用。对于Group A来说,合适的索引组合是0,4,9,9,9,9,产生字符串myfunction。另一方面,参数将使用$结构的可变变量。对Group B来说,合适的索引应该是7和8,等于$a$和b即$a和$b。因此答案是D。15在较新版本的PHP中,require(或requier_once())和include()(或include_once()只有一个区别如果包含的文件不存在,前者将产生一个致命错误,同时终止脚本的执行;而后者只会产生一个警告。因此答案E正确。16当参数被声明为通过引用传递时,你不能给它赋默认值,此时解释器期望获得一个能在函数内部进行修改的变量。答

17、案是C。17正确答案是逻辑异或(xor)运算符。18全等运算符比较两个操作数的数据类型和值,两者中有一个不同,都会返回False。因此答案是B。19答案是A和C。A选项中,pow函数计算2的平方,答案是4。C选项中,左移运算符将$a的值左移两位,相当于乘以4。20答案是A。一段脚本并不会在执行到文件末尾时终止,所以当前文件才能被其他脚本包含。至于PHP和Apache崩溃,这两个说法就太恶搞了。第二章(Object-oriented Programming with PHP 4)ZendChina官方:尽管PHP 4不是一个成功的面向对象技术的典范,但是它适用于建立一个可行的面向对象的架构你只需

18、要了解一个有缺陷的对象模型的缺陷在哪,并围绕着它小心处理。即使PHP 5在PHP处理对象的方式上已经带来了许多的变化,从而你可能受到吸引而忽视了PHP 4的能力。事实是,这个面向对象的程序设计是非常受大多数程序员欢迎的,这些程序员在开始开发自己的应用软件时都是使用这个老版本的PHP。这导致了有大量的OOP代码,甚至在你转向PHP 5之前,你也可能会经常使用到这些代码。考试的 OOP 部分不仅仅测试常用的面向对象开发,同时也测试PHP 4实现OOP的独特方式。1. What is the construct used to define the blueprint of an object ca

19、lled?Your Answer: _2. At the end of the execution of the following script, which values will be stored in the $a->my_value array? (Choose 3)A. cB. bC. aD. dE. e3. How can you write a class so that some of its properties cannot be accessed from outside its methods?A. By declaring the class as priv

20、ateB. By declaring the methods as privateC. It cannot be doneD. By writing a property overloading method4. Which object-oriented pattern would you use to implement a class that must be instantiated only once for the entire lifespan of a script?A. Model-view-controllerB. Abstract factoryC. SingletonD

21、. ProxyE. State5. A class can be built as an extension of other classes using a process known as inheritance. In PHP, how many parents can a child class inherit from?A. OneB. TwoC. Depends on system resourcesD. ThreeE. As many as needed6. What OOP construct unavailable in PHP 4 does the following sc

22、ript approximate?A. Multiple inheritanceB. InterfacesC. Abstract methodsD. Private methodsE. Function overloading7. Assume that a class called testclass is defined. What must the name of its constructor method be?A. _constructB. initializeC. testclassD. _testclassE. Only PHP 5 supports constructors8

23、. How can a class override the default serialization mechanism for its objects?A. By implementing the _shutdown and _startup methodsB. By calling register_shutdown_function()C. By implementing _sleep() and _wakeup()D. The default serialization mechanism cannot be overriddenE. By adding the class to the output buffering mechanism using ob_start()9. In PHP 4, which object-oriented constructs from the following list are not available? Abstract classes Final classes Public, private, protected (PPP) methods InterfacesA. Abstract

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1