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...

面试题 相关文章推荐
PHP如何对用户密码进行加密
Jul 31 面试题
C++:memset ,memcpy和strcpy的根本区别
Apr 27 面试题
C++是不是类型安全的
Feb 18 面试题
SQL SERVER面试资料
Mar 30 面试题
SQL里面如何插入自动增长序列号字段
Mar 29 面试题
什么是Connection-oriented Protocol/Connectionless Protocol面向连接的协议/无连接协议
Sep 06 面试题
介绍一下HTTP、HTTPS和SSL
Dec 16 面试题
介绍一下linux文件系统分配策略
Nov 17 面试题
说一下Linux下有关用户和组管理的命令
Jan 04 面试题
海量信息软件测试笔试题
Aug 08 面试题
Prototype是怎么扩展DOM的
Oct 01 面试题
Java面试题冲刺第十七天--基础篇3
Aug 07 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
mongo Table类文件 获取MongoCursor(游标)的实现方法分析
2013/07/01 PHP
CodeIgniter配置之database.php用法实例分析
2016/01/20 PHP
幻灯片带网页设计中的20个奇妙应用示例小结
2012/05/27 Javascript
jQuery JSON实现无刷新三级联动实例探讨
2013/05/28 Javascript
js将字符串转成正则表达式的实现方法
2013/11/13 Javascript
用javascript删除当前行,添加行(示例代码)
2013/11/25 Javascript
js二维数组排序的简单示例代码
2014/01/24 Javascript
jQuery中replaceWith()方法用法实例
2014/12/25 Javascript
JS深度拷贝Object Array实例分析
2016/03/31 Javascript
jquery网页日历显示控件calendar3.1使用详解
2016/11/24 Javascript
Webpack中css-loader和less-loader的使用教程
2017/04/27 Javascript
Vue render函数实战之实现tabs选项卡组件
2019/04/22 Javascript
layui数据表格 table.render 报错的解决方法
2019/09/29 Javascript
Windows下安装python2.7及科学计算套装
2015/03/05 Python
python实现在每个独立进程中运行一个函数的方法
2015/04/23 Python
对Tensorflow中权值和feature map的可视化详解
2018/06/14 Python
pytorch中tensor的合并与截取方法
2018/07/26 Python
Django分页查询并返回jsons数据(中文乱码解决方法)
2018/08/02 Python
详解如何用django实现redirect的几种方法总结
2018/11/22 Python
浅谈python新式类和旧式类区别
2019/04/26 Python
numpy 声明空数组详解
2019/12/05 Python
Python中的 ansible 动态Inventory 脚本
2020/01/19 Python
python PIL模块的基本使用
2020/09/29 Python
解决pytorch 的state_dict()拷贝问题
2021/03/03 Python
英国领先的在线高尔夫商店:Scottsdale Golf
2019/08/26 全球购物
联强国际笔试题面试题
2013/07/10 面试题
迟到检讨书5000字
2014/01/31 职场文书
九年级政治教学反思
2014/02/06 职场文书
保证书范文大全
2014/04/28 职场文书
市级青年文明号申报材料
2014/05/26 职场文书
销售队伍口号
2014/06/11 职场文书
学校班子个人对照检查材料思想汇报
2014/09/27 职场文书
党的群众路线教育实践活动党员个人剖析材料
2014/10/08 职场文书
小学教师教学反思
2016/02/24 职场文书
vue首次渲染全过程
2021/04/21 Vue.js
教你一步步实现一个简易promise
2021/11/02 Javascript