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

面试题 相关文章推荐
开发中都用到了那些设计模式?用在什么场合?
Aug 21 面试题
采用怎样的方法保证数据的完整性
Dec 02 面试题
北京泡泡网网络有限公司.net面试题
Jul 17 面试题
杭州联环马网络笔试题面试题
Aug 04 面试题
某公司.Net方向面试题
Apr 24 面试题
XML文档面试题
Aug 05 面试题
介绍一下Linux中的链接
May 28 面试题
软件测试笔试题
Oct 25 面试题
GWebs公司笔试题
May 04 面试题
介绍一下XMLHttpRequest对象
Feb 12 面试题
JDBC操作数据库的基本流程是什么
Oct 28 面试题
Servlet如何得到服务器的信息
Dec 22 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
浅析php静态方法与非静态方法的用法区别
2016/05/17 PHP
php基于dom实现读取图书xml格式数据的方法
2017/02/03 PHP
php数值转换时间及时间转换数值用法示例
2017/05/18 PHP
tp5框架使用composer实现日志记录功能示例
2019/01/10 PHP
JavaScript 的方法重载效果
2009/08/07 Javascript
javascript中的new使用
2010/03/20 Javascript
在iframe里的页面编写js,实现在父窗口上创建动画效果展开和收缩的div(不变动iframe父窗口代码)
2011/12/20 Javascript
JQuery中Text方法用法实例分析
2015/05/18 Javascript
javascript中的previousSibling和nextSibling的正确用法
2015/09/16 Javascript
不依赖Flash和任何JS库实现文本复制与剪切附源码下载
2015/10/09 Javascript
JavaScript基础篇(3)之Object、Function等引用类型
2015/11/30 Javascript
微信小程序前端源码逻辑和工作流
2016/09/25 Javascript
angular实现图片懒加载实例代码
2017/06/08 Javascript
three.js中文文档学习之如何本地运行详解
2017/11/20 Javascript
vue组件挂载到全局方法的示例代码
2018/08/02 Javascript
Vue唯一可以更改vuex实例中state数据状态的属性对象Mutation的讲解
2019/01/18 Javascript
JavaScript函数IIFE使用详解
2019/10/21 Javascript
从零使用TypeScript开发项目打包发布到npm
2020/02/14 Javascript
Python collections模块实例讲解
2014/04/07 Python
Python django使用多进程连接mysql错误的解决方法
2018/10/08 Python
pycharm的console输入实现换行的方法
2019/01/16 Python
python2爬取百度贴吧指定关键字和图片代码实例
2019/08/14 Python
解析pip安装第三方库但PyCharm中却无法识别的问题及PyCharm安装第三方库的方法教程
2020/03/10 Python
利用Python裁切tiff图像且读取tiff,shp文件的实例
2020/03/10 Python
详解python tkinter包获取本地绝对路径(以获取图片并展示)
2020/09/04 Python
python日志通过不同的等级打印不同的颜色(示例代码)
2021/01/13 Python
详解canvas在圆弧周围绘制文本的两种写法
2018/05/22 HTML / CSS
NYX Professional Makeup官方网站:专业彩妆和美容产品
2019/10/29 全球购物
学生档案自我鉴定
2013/10/07 职场文书
工程监理应届生求职信
2013/11/09 职场文书
中式面点餐厅创业计划书
2014/01/29 职场文书
保安部任务及岗位职责
2014/02/25 职场文书
小学庆六一活动方案
2014/02/28 职场文书
乡镇三项教育实施方案
2014/03/30 职场文书
python tkinter实现定时关机
2021/04/21 Python
关于React Native 无法链接模拟器的问题
2021/06/21 Javascript