Yahoo的PHP面试题


Posted in 面试题 onMay 26, 2014
A friend recently got some pre-interview questions from YAHOO for a PHP job. Following up my previous post about programmer questions I thought I would post them to give people examples of what a large corporation like YAHOO asks.
1. Which of the following will not add john to the users array?
1. $users[] = ‘john’;
2. array_add($users,’john’);
3. array_push($users,‘john’);
4. $users ||= ‘john’;
2. What’s the difference between sort(), assort() and ksort? Under what circumstances would you use each of these?
3. What would the following code print to the browser? Why?
$num = 10;
function multiply(){
$num = $num * 10;
}
multiply();
echo$num;
4. What is the difference between a reference and a regular variable? How do you pass by reference & why would you want to?
5. What functions can you use to add library code to the currently running script?
6. What is the difference between foo() & @foo()?
7. How do you debug a PHP application?
8. What does === do? What’s an example of something that will give true for ‘==’, but not ‘===’?
9. How would you declare a class named “myclass” with no methods or properties?
10. How would you create an object, which is an instance of “myclass”?
11. How do you access and set properties of a class from within the class?
12. What is the difference between include & include_once? include & require?
13. What function would you use to redirect the browser to a new page?
1. redir()
2. header()
3. location()
4. redirect()
14. What function can you use to open a file for reading and writing?
1. fget();
2. file_open();
3. fopen();
4. open_file();
15. What’s the difference between mysql_fetch_row() and mysql_fetch_array()?
16. What does the following code do? Explain what’s going on there.
$date=’08/26/2003’;
printereg_replace(“([0-9]+)/([0-9]+)/([0-9]+)”,2/1/3,$date);
17. Given a line of text $string, how would you write a regular expression to strip all the HTML tags from it?
18. What’s the difference between the way PHP and Perl distinguish between arrays and hashes?
19. How can you get round the stateless nature of HTTP using PHP?
20. What does the GD library do?
21. Name a few ways to output (print) a block of HTML code in PHP?
22. Is PHP better than Perl? – Discuss.

Tags in this post...

面试题 相关文章推荐
在Java开发中如何选择使用哪种集合类
Aug 09 面试题
C语言笔试题回忆
Apr 02 面试题
估算杭州有多少软件工程师
Aug 11 面试题
NULL是什么,它是怎么定义的
May 09 面试题
查询优化的一般准则有哪些
Mar 08 面试题
什么情况下你必须要把一个类定义为abstract的
Jan 06 面试题
如何开启linux的ssh服务
Feb 14 面试题
非功能性需求都包括哪些方面
Oct 29 面试题
EJB与JAVA BEAN的区别
Aug 29 面试题
Prototype如何为一个Ajax添加一个参数
Dec 06 面试题
如何用Python输出一个Fibonacci数列
Aug 28 面试题
Delphi软件工程师试题
Jan 29 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
不用mod_rewrite直接用php实现伪静态化页面代码
2008/10/04 PHP
在WordPress的文章编辑器中设置默认内容的方法
2015/12/29 PHP
php安全配置记录和常见错误梳理(总结)
2017/03/28 PHP
Thinkphp框架+Layui实现图片/文件上传功能分析
2020/02/07 PHP
jquery radio 操作代码
2011/03/16 Javascript
jquery tab插件精简版分享
2011/09/10 Javascript
JavaScript中数组的排序、乱序和搜索实现代码
2011/11/30 Javascript
你的 mixin 真的兼容 ECMAScript 5 吗?
2013/04/11 Javascript
js实现Select头像选择实时预览代码
2015/08/17 Javascript
用jquery获取自定义的标签属性的值简单实例
2016/09/17 Javascript
vue.js树形组件之删除双击增加分支实例代码
2017/02/28 Javascript
jQuery中的deferred对象和extend方法详解
2017/05/08 jQuery
详解在express站点中使用ejs模板引擎
2017/09/21 Javascript
vue2.0 + ele的循环表单及验证字段方法
2018/09/18 Javascript
了解JavaScript函数中的默认参数
2019/05/30 Javascript
Vue项目中如何使用Axios封装http请求详解
2019/10/23 Javascript
JS通用方法触发点击事件代码实例
2020/02/17 Javascript
vue自定义组件实现双向绑定
2021/01/13 Vue.js
Python脚本实现集群检测和管理功能
2015/03/06 Python
Python安装图文教程 Pycharm安装教程
2018/03/27 Python
python skimage 连通性区域检测方法
2018/06/21 Python
浅析python参数的知识点
2018/12/10 Python
深入浅析Python 中 is 语法带来的误解
2019/05/07 Python
wxpython布局的实现方法
2019/11/01 Python
浅谈keras2 predict和fit_generator的坑
2020/06/17 Python
如何解决cmd运行python提示不是内部命令
2020/07/01 Python
html5+css3之CSS中的布局与Header的实现
2014/11/21 HTML / CSS
师范生个人推荐信
2013/11/29 职场文书
教堂婚礼主持词
2014/03/14 职场文书
《放小鸟》教学反思
2014/04/20 职场文书
双拥工作宣传标语
2014/06/26 职场文书
2014年学校工会工作总结
2014/12/06 职场文书
JS + HTML 罗盘式时钟的实现
2021/05/21 Javascript
如何在pycharm中快捷安装pip命令(如pygame)
2021/05/31 Python
golang三种设计模式之简单工厂、方法工厂和抽象工厂
2022/04/10 Golang
Win11怎么添加用户?Win11添加用户账户的方法
2022/07/15 数码科技