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

面试题 相关文章推荐
联强国际笔试题面试题
Jul 10 面试题
随机分配座位,共50个学生,使学号相邻的同学座位不能相邻
Jan 18 面试题
联想C++笔试题
Jun 13 面试题
NET程序员上机面试题
May 23 面试题
你对IPv6了解程度
Feb 09 面试题
介绍一下grep命令的使用
Jun 28 面试题
nohup的用法
Aug 10 面试题
飞利信loadrunner和软件测试笔试题
Sep 22 面试题
介绍一下Mysql的存储引擎
Feb 12 面试题
如何用Java实现列出某个目录下的所有子目录
Jul 20 面试题
如何写出好的Java代码
Apr 25 面试题
J2EE中常用的名词进行解释
Nov 09 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
采集邮箱的php代码(抓取网页中的邮箱地址)
2012/07/17 PHP
PHP之正则表达式捕获组与非捕获组(详解)
2015/07/29 PHP
PHP实现创建微信自定义菜单的方法示例
2017/07/14 PHP
PHP+redis实现的限制抢购防止商品超发功能详解
2019/09/19 PHP
JS函数this的用法实例分析
2015/02/05 Javascript
JS中prototype的用法实例分析
2015/03/19 Javascript
jQuery抛物线运动实现方法(附完整demo源码下载)
2016/01/08 Javascript
vue实现添加标签demo示例代码
2017/01/21 Javascript
Vue.js学习之计算属性
2017/01/22 Javascript
Ajax高级笔记 JavaScript高级程序设计笔记
2017/06/22 Javascript
React Native中TabBarIOS的简单使用方法示例
2017/10/13 Javascript
Vuex 快速入门(简单易懂)
2018/09/20 Javascript
微信小程序如何获取手机验证码
2018/11/04 Javascript
快速搭建Node.js(Express)用户注册、登录以及授权的方法
2019/05/09 Javascript
javascript实现画板功能
2020/04/12 Javascript
Chrome插件开发系列一:弹窗终结者开发实战
2020/10/02 Javascript
JavaScript实现网页动态生成表格
2020/11/25 Javascript
[02:56]DOTA2矮人直升机 英雄基础教程
2013/11/26 DOTA
python使用Queue在多个子进程间交换数据的方法
2015/04/18 Python
pandas DataFrame实现几列数据合并成为新的一列方法
2018/06/08 Python
深入理解Django-Signals信号量
2019/02/19 Python
使用Django搭建web服务器的例子(最最正确的方式)
2019/08/29 Python
python 实现读取csv数据,分类求和 再写进 csv
2020/05/18 Python
python+selenium 简易地疫情信息自动打卡签到功能的实现代码
2020/08/22 Python
一文带你了解Python 四种常见基础爬虫方法介绍
2020/12/04 Python
Python 实现进度条的六种方式
2021/01/06 Python
森海塞尔美国官网:Sennheiser耳机与耳麦
2017/07/19 全球购物
淘宝中秋节活动方案
2014/01/31 职场文书
校园摄影活动策划方案
2014/02/05 职场文书
合作意向书格式及范文
2014/03/31 职场文书
校庆标语集锦
2014/06/25 职场文书
市场营销专业毕业生求职信
2014/07/21 职场文书
2015年党员个人剖析材料
2014/12/18 职场文书
挂靠协议书
2015/01/27 职场文书
资料员岗位职责范本
2015/04/13 职场文书
酒店厨房管理制度
2015/08/06 职场文书