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

面试题 相关文章推荐
mysql的最长数据库名,表名,字段名可以是多长
Apr 21 面试题
康拓普公司Java笔面试
Sep 23 面试题
到底Java是如何传递参数的?是by value或by reference?
Jul 13 面试题
如何打开WebSphere远程debug
Oct 10 面试题
数据库什么时候应该被重组
Nov 02 面试题
什么叫应用程序域?什么是托管代码?什么是强类型系统?什么是装箱和拆箱?什么是重载?CTS、CLS和CLR分别作何解释?
May 23 面试题
网络技术支持面试题
Apr 22 面试题
简述安装Slackware Linux系统的过程
Jan 12 面试题
什么是符号链接,什么是硬链接?符号链接与硬链接的区别是什么?
Jan 19 面试题
几个MySql的面试题
Apr 22 面试题
Java Servlet API中forward() 与redirect()的区别
Apr 20 面试题
DELPHI中如何调用API,可举例说明
Jan 16 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
php验证手机号码(支持归属地查询及编码为UTF8)
2013/02/01 PHP
php 模拟post_验证页面的返回状态(实例讲解)
2013/10/28 PHP
用 Composer构建自己的 PHP 框架之使用 ORM
2014/10/30 PHP
轻量级 JS ToolTip提示效果
2010/07/20 Javascript
jQuery的实现原理的模拟代码 -1 核心部分
2010/08/01 Javascript
JS判断页面加载状态以及添加遮罩和缓冲动画的代码
2012/10/11 Javascript
js中arguments,caller,callee,apply的用法小结
2014/01/28 Javascript
js的hasownproperty使用示例
2014/03/02 Javascript
Jquery之Bind方法参数传递与接收的三种方法
2014/06/24 Javascript
JavaScript中跨域调用Flash的方法
2014/08/11 Javascript
cookie的secure属性详解
2015/04/08 Javascript
javascript实现漂亮的拖动层,窗口拖拽特效
2015/04/24 Javascript
使用javascript提交form表单方法汇总
2015/06/25 Javascript
文字垂直滚动之javascript代码
2015/07/29 Javascript
vue组件间通信子与父详解(二)
2017/11/07 Javascript
微信小程序转发事件实现解析
2019/10/22 Javascript
JS实现放烟花效果
2020/03/10 Javascript
Vue.extend 登录注册模态框的实现
2020/12/29 Vue.js
python面向对象_详谈类的继承与方法的重载
2017/06/07 Python
python实现基于SVM手写数字识别功能
2020/05/27 Python
Python反转序列的方法实例分析
2018/03/21 Python
pandas 选择某几列的方法
2018/07/03 Python
pymongo中聚合查询的使用方法
2019/03/22 Python
python中使用while循环的实例
2019/08/05 Python
解决pycharm 安装numpy失败的问题
2019/12/05 Python
python FTP批量下载/删除/上传实例
2019/12/22 Python
Python 实现自动登录+点击+滑动验证功能
2020/06/10 Python
浅析CSS3中鲜为人知的属性:-webkit-tap-highlight-color
2017/01/12 HTML / CSS
澳大利亚设计的优质鞋类和适合澳大利亚生活方式的服装:Rivers
2019/04/23 全球购物
英文求职信结束语大全
2013/10/26 职场文书
中班中秋节活动反思
2014/02/18 职场文书
餐厅采购员岗位职责
2014/03/06 职场文书
弘扬民族精神演讲稿
2014/05/07 职场文书
煤矿安全保证书
2015/02/27 职场文书
小学五年级(说明文3篇)
2019/08/13 职场文书
Python 如何利用ffmpeg 处理视频素材
2021/11/27 Python