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 02 面试题
枚举和一组预处理的#define有什么不同
Sep 21 面试题
聚网科技C++面试笔试题
Sep 01 面试题
将"引用"作为函数返回值类型的格式、好处和需要遵守的规则
Feb 09 面试题
写出SQL四条最基本的数据操作语句(DML)
Dec 12 面试题
北京一家公司的.net开发工程师笔试题
Apr 17 面试题
什么是托管函数?托管函数有什么用?
Jun 15 面试题
盛大笔试题
Nov 05 面试题
面向对象设计的原则是什么
Feb 13 面试题
EJB的基本架构
Sep 22 面试题
创联软件面试题笔试题
Oct 07 面试题
Promise面试题详解之控制并发
May 14 面试题
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/01/19 PHP
php curl获取网页内容(IPV6下超时)的解决办法
2013/07/16 PHP
使用PHP生成二维码的方法汇总
2015/07/22 PHP
php+jquery+html实现点击不刷新加载更多的实例代码
2016/08/12 PHP
PHP递归获取目录内所有文件的实现方法
2016/11/01 PHP
php 删除指定文件夹的实例讲解
2017/07/25 PHP
javascript中IE浏览器不支持NEW DATE()带参数的解决方法
2012/03/01 Javascript
可选择和输入的下拉列表框示例
2013/11/05 Javascript
Script标签与访问HTML页面详解
2014/01/10 Javascript
js的隐含参数(arguments,callee,caller)使用方法
2014/01/28 Javascript
封装好的js判断操作系统与浏览器代码分享
2015/01/09 Javascript
jQuery实现的Tab滑动选项卡及图片切换(多种效果)小结
2015/09/14 Javascript
jQuery插件实现表格隔行变色及鼠标滑过高亮显示效果代码
2016/02/25 Javascript
基于JavaScript实现多级菜单效果
2017/07/25 Javascript
微信小程序左滑删除功能开发案例详解
2018/11/12 Javascript
详解javascript replace高级用法
2019/02/17 Javascript
Layui多选只有最后一个值的解决方法
2019/09/02 Javascript
Python+Opencv识别两张相似图片
2020/03/23 Python
python将文本中的空格替换为换行的方法
2018/03/19 Python
Pandas 合并多个Dataframe(merge,concat)的方法
2018/06/08 Python
django的分页器Paginator 从django中导入类
2019/07/25 Python
Python 图像对比度增强的几种方法(小结)
2019/09/25 Python
Python生成验证码、计算具体日期是一年中的第几天实例代码详解
2019/10/16 Python
Python实现定时监测网站运行状态的示例代码
2020/09/30 Python
Django web自定义通用权限控制实现方法
2020/11/24 Python
虚拟环境及venv和virtualenv的区别说明
2021/02/05 Python
IE9对HTML5中部分属性不支持的原因分析
2014/10/15 HTML / CSS
Blue Nile台湾:钻石珠宝商,订婚首饰、结婚戒指和精品首饰
2017/11/24 全球购物
吉尔德利巧克力公司:Ghirardelli Chocolate Company
2019/03/27 全球购物
乐高西班牙官方商店:LEGO Shop ES
2019/12/01 全球购物
办公室主任职责范文
2013/11/08 职场文书
大型活动策划方案
2014/01/12 职场文书
2014年党员公开承诺践诺书
2014/03/25 职场文书
2014年银行个人工作总结
2014/12/05 职场文书
Python Matplotlib绘制条形图的全过程
2021/10/24 Python
欧元符号 €
2022/02/17 杂记