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

面试题 相关文章推荐
下面这个程序执行后会有什么错误或者效果
Nov 03 面试题
C++的几个面试题附答案
Aug 03 面试题
如何删除一个表里面的重复行
Jul 13 面试题
如何开发安全的AJAX应用
Mar 26 面试题
Python如何实现单例模式
Jun 03 面试题
MYSQL相比于其他数据库有哪些特点
Jul 19 面试题
MYSQL支持事务吗
Aug 09 面试题
swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上?
Mar 30 面试题
Vector, ArrayList, HashTable, HashMap哪些是线程安全的,哪些不是
Oct 12 面试题
J2ee常用的设计模式?说明工厂模式
May 21 面试题
Delphi软件工程师试题
Jan 29 面试题
介绍一下你对SOA的认识
Apr 24 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
Yii核心验证器api详解
2016/11/23 PHP
PHP仿qq空间或朋友圈发布动态、评论动态、回复评论、删除动态或评论的功能(上)
2017/05/26 PHP
在Yii2特定页面如何禁用调试工具栏Debug Toolbar详解
2017/08/07 PHP
JavaScript 输入框内容格式验证代码
2010/02/11 Javascript
JQuery实现点击div以外的位置隐藏该div窗口
2013/09/13 Javascript
基于JQuery实现滚动到页面底端时自动加载更多信息
2014/01/31 Javascript
百度地图api如何使用
2015/08/03 Javascript
D3.js中data(), enter() 和 exit()的问题详解
2015/08/17 Javascript
avalon js实现仿google plus图片多张拖动排序附源码下载
2015/09/24 Javascript
jquery 实时监听输入框值变化的完美方法(必看)
2017/01/26 Javascript
vue-router中的hash和history两种模式的区别
2018/07/17 Javascript
Vue-Quill-Editor富文本编辑器的使用教程
2018/09/21 Javascript
vue(2.x,3.0)配置跨域代理
2019/11/27 Javascript
vue 实现图片懒加载功能
2020/12/31 Vue.js
[28:42]Ti4正赛VG vs NEWBEE1
2014/07/19 DOTA
python利用beautifulSoup实现爬虫
2014/09/29 Python
Python类方法__init__和__del__构造、析构过程分析
2015/03/06 Python
在Python中使用NLTK库实现对词干的提取的教程
2015/04/08 Python
深入理解Python装饰器
2016/07/27 Python
使用Python & Flask 实现RESTful Web API的实例
2017/09/19 Python
Django中间件实现拦截器的方法
2018/06/01 Python
Flask框架各种常见装饰器示例
2018/07/17 Python
Python使用pydub库对mp3与wav格式进行互转的方法
2019/01/10 Python
用Python逐行分析文件方法
2019/01/28 Python
Python I/O与进程的详细讲解
2019/03/08 Python
Tensorflow--取tensorf指定列的操作方式
2020/06/30 Python
关于HTML5+ API plusready的兼容问题
2020/11/20 HTML / CSS
美国网上眼镜供应商:LEOTONY(眼镜、RX太阳镜和太阳镜)
2017/10/31 全球购物
澳大利亚运动鞋商店:Platypus Shoes
2019/09/27 全球购物
德国购买踏板车网站:Microscooter
2019/10/14 全球购物
自荐信范文
2013/12/10 职场文书
2014年大学生党课心得体会范文
2014/03/29 职场文书
项目合作协议书
2014/04/16 职场文书
2014年党风建设工作总结
2014/11/19 职场文书
详解Python requests模块
2021/06/21 Python
Python 图片添加美颜效果
2022/04/28 Python