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

面试题 相关文章推荐
叙述DBMS对数据控制功能有哪些
Jun 12 面试题
用友笔试题目
Oct 25 面试题
什么叫应用程序域?什么是受管制的代码?什么是强类型系统?什么是装箱和拆箱?
Aug 13 面试题
动态密码技术
Oct 18 面试题
LINUX下线程,GDI类的解释
Apr 17 面试题
什么是makefile? 如何编写makefile?
Aug 08 面试题
品恩科技软件测试面试题
Oct 26 面试题
Lucene推荐的分页方式是什么?
Dec 07 面试题
什么是继承
Dec 07 面试题
Java程序员面试题
Jul 15 面试题
Unix控制后台进程都有哪些进程
Sep 22 面试题
解释一下ruby中的特殊方法与特殊类
Feb 26 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
php 静态变量与自定义常量的使用方法
2010/01/26 PHP
如何使用php判断服务器是否是HTTPS连接
2013/07/05 PHP
[原创]ThinkPHP中SHOW_RUN_TIME不能正常显示运行时间的解决方法
2015/10/10 PHP
WordPress后台中实现图片上传功能的实例讲解
2016/01/11 PHP
php+jquery+html实现点击不刷新加载更多的实例代码
2016/08/12 PHP
Yii2框架数据验证操作实例详解
2018/05/02 PHP
Laravel框架路由和控制器的绑定操作方法
2018/06/12 PHP
弹出最简单的模式化遮罩层的js代码
2013/12/04 Javascript
jquery分页对象使用示例
2014/04/01 Javascript
node.js中的querystring.unescape方法使用说明
2014/12/10 Javascript
js实现遍历含有input的table实例
2015/12/07 Javascript
JS树形菜单组件Bootstrap TreeView使用方法详解
2016/12/21 Javascript
JS基于onclick事件实现单个按钮的编辑与保存功能示例
2017/02/13 Javascript
Vue基于NUXT的SSR详解
2017/10/24 Javascript
微信小程序使用swiper组件实现层叠轮播图
2018/11/04 Javascript
vue.js引入外部CSS样式和外部JS文件的方法
2019/01/06 Javascript
JavaScript创建对象的四种常用模式实例分析
2019/01/11 Javascript
详解微信小程序网络请求接口封装实例
2019/05/02 Javascript
弱类型语言javascript开发中的一些坑实例小结【变量、函数、数组、对象、作用域等】
2019/08/07 Javascript
[01:11:08]Winstrike vs NB 2018国际邀请赛淘汰赛BO1 8.21
2018/08/22 DOTA
python使用正则表达式提取网页URL的方法
2015/05/26 Python
python轻松查到删除自己的微信好友
2016/01/10 Python
Python利用WMI实现ping命令的例子
2019/08/14 Python
Python字符串函数strip()原理及用法详解
2020/07/23 Python
英国儿童鞋和靴子:Start-Rite
2019/05/06 全球购物
西班牙在线光学:Visual-Click
2020/06/22 全球购物
教师党员公开承诺书
2014/03/25 职场文书
2014年“四风”问题个人整改措施
2014/09/17 职场文书
北京颐和园导游词
2015/01/30 职场文书
银行实习推荐信
2015/03/27 职场文书
幼儿园教师安全责任书
2015/05/08 职场文书
党员公开承诺书(2016最新版)
2016/03/24 职场文书
靠谱的活动总结
2019/04/16 职场文书
好段摘抄大全(48句)
2019/08/08 职场文书
python脚本框架webpy模板控制结构
2021/11/20 Python
MySQL 计算连续登录天数
2022/05/11 MySQL