亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問板塊 發(fā)新帖
查看: 670873 | 回復(fù): 456
打印 上一主題 下一主題

PHP工程師筆試題匯總 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2011-01-27 21:16 |只看該作者 |倒序?yàn)g覽
騰訊PHP工程師筆試題
騰訊PHP工程師筆試題.rar (2.89 KB, 下載次數(shù): 1327)
新浪php工程師的面試題(編程部分)
游客,如果您要查看本帖隱藏內(nèi)容請(qǐng)回復(fù)

Yahoo! PHP 筆試題
游客,如果您要查看本帖隱藏內(nèi)容請(qǐng)回復(fù)



騰訊PHP工程師筆試題
1. 請(qǐng)對(duì)POSIX風(fēng)格和兼容Perl風(fēng)格兩種正則表達(dá)式的主要函數(shù)進(jìn)行類比說明
ereg preg_match
ereg_replace preg_replace


2. 請(qǐng)說明在php.ini中safe_mode開啟之后對(duì)于PHP系統(tǒng)函數(shù)的影響


3. PHP5中魔術(shù)方法函數(shù)有哪幾個(gè),請(qǐng)舉例說明各自的用法

__sleep
__wakeup
__toString
__set_state
__construct,
__destruct
__call,
__get,
__set,
__isset,
__unset
__sleep,
__wakeup,
__toString,
__set_state,
__clone
__autoload


4. 請(qǐng)寫出讓,并說明如何在命令行下運(yùn)行PHP腳本(寫出兩種方式)同時(shí)向PHP腳本傳遞參數(shù)?


5. PHP的垃圾收集機(jī)制是怎樣的


6.使對(duì)象可以像數(shù)組一樣進(jìn)行foreach循環(huán),要求屬性必須是私有。
(Iterator模式的PHP5實(shí)現(xiàn),寫一類實(shí)現(xiàn)Iterator接口)


7.請(qǐng)寫一段PHP代碼,確保多個(gè)進(jìn)程同時(shí)寫入同一個(gè)文件成功


8. 用PHP實(shí)現(xiàn)一個(gè)雙向隊(duì)列


9. 使用正則表達(dá)式提取一段標(biāo)識(shí)語(yǔ)言(html或xml)代碼段中指定標(biāo)簽的指定屬性值(需考慮屬性值對(duì)不規(guī)則的情況,如大小寫不敏感,屬性名值與等號(hào)間有空格等)。此處假設(shè)需提取test標(biāo)簽的attr屬性值,請(qǐng)自行構(gòu)建包含該標(biāo)簽的串

<test attr=”ddd”>

<test attr\s*=\s*[“ ¦’](.*?)[” ¦’].*?>


10.請(qǐng)使用socket相關(guān)函數(shù)(非curl)實(shí)現(xiàn)如下功能:構(gòu)造一個(gè)post請(qǐng)求,發(fā)送到指定http server的指定端口的指定請(qǐng)求路徑(如http://www.example.com:8080/test)。請(qǐng)求中包含以下變量:
用戶名(username):溫柔一刀
密碼(pwd):&123=321&321=123&
個(gè)人簡(jiǎn)介(intro):Hello world!

且該http server需要以下cookie來(lái)進(jìn)行簡(jiǎn)單的用戶動(dòng)作跟蹤:

cur_query:you&me
last_tm:...(上次請(qǐng)求的unix時(shí)間戳,定為當(dāng)前請(qǐng)求時(shí)間前10分鐘)
cur_tm:...(當(dāng)前請(qǐng)求的unix時(shí)間戳)
設(shè)置超時(shí)為10秒,發(fā)出請(qǐng)求后,將http server的響應(yīng)內(nèi)容輸出。
1.
Function encode($data, $sep = ‘&’){
2.
while (list($k,$v) = each($data)) {
3.
$encoded .= ($encoded ? "$sep" : "";
4.
$encoded .= rawurlencode($k)."=".rawurlencode($v);
5.
}
6.
Return $encoded;
7.
}
8.

9.
Function post($url, $post, $cookie){
10.
$url = parse_url($url);
11.
$post = encode($data, ‘&’);
12.
$cookie = encode($cookieArray, ‘;’);
13.
$fp = fsockopen($url['host'], $url['port'] ? $url['port'] : 80, $errno, $errstr, 10);
14.
if (!$fp) return "Failed to open socket to $url[host]";
15.

16.
fputs($fp, sprintf("OST %s%s%s HTTP/1.0\n", $url['path'], $url['query'] ? "?" : "", $url['query']));
17.
fputs($fp, "Host: $url[host]\n";
18.
fputs($fp, "Content-type: application/x-www-form-urlencoded\n";
19.
fputs($fp, "Content-length: " . strlen($encoded) . "\n";
20.
fputs($fp, "Cookie: $cookie\n\n";
21.
fputs($fp, "Connection: close\n\n";
22.
fputs($fp, "$post \n";
23.

24.
while (!feof($fp)) {
25.
echo fgets($fp, 12;
26.
}
27.
fclose($fp);
28.
}
29.

30.
$url = ‘http://www.example.com:8080/test’;
31.
$encoded = username=溫柔一刀& pwd=
32.
$post = array(
33.
‘username’=> ‘溫柔一刀’,
34.
‘pwd => ‘&123=321&321=123&’,
35.
‘intro => ‘Hello world!’
36.
);
37.
$cookie = array(
38.
‘cur_query’ => ‘you&me,
39.
‘last_tm’ => time() - 600,
40.
‘cur_tm ‘=> time()
41.
);
42.

43.
Post($url, $post, $cookie);
復(fù)制代碼
11.你用什么方法檢查PHP腳本的執(zhí)行效率(通常是腳本執(zhí)行時(shí)間)和數(shù)據(jù)庫(kù)SQL的效率(通常是數(shù)據(jù)庫(kù)Query時(shí)間),并定位和分析腳本執(zhí)行和數(shù)據(jù)庫(kù)查詢的瓶頸所在?
1.腳本執(zhí)行時(shí)間,啟用xdebug,使用WinCacheGrind分析。
2.?dāng)?shù)據(jù)庫(kù)查詢,mysql使用EXPLAIN分析查詢,啟用slow query log記錄慢查詢。


PHP LAMP Engineer Test Paper
Question 1
What does <? echo count ("123" ?> print out?
A) 3
B) False
C) Null
D) 1
E) 0

Question 2
Which of the following snippets prints a representation of 42 with two decimal places?
A) printf("%.2d\n", 42);
B) printf("%1.2f\n", 42);
C) printf("%1.2u\n", 42);

Question 3
Given
$text = 'Content-Type: text/xml';
Which of the following prints 'text/xml'?
A) print substr($text, strchr($text, ':'));
B) print substr($text, strchr($text, ':') + 1);
C) print substr($text, strpos($text, ':') + 1);
D) print substr($text, strpos($text, ':') + 2);
E) print substr($text, 0, strchr($text, ':')
Question 4
What is the value of $a?
<?php
$a = in_array('01', array('1')) == var_dump('01' == 1);
?>
A) True
B) False
Question 5
What is the value of $result in the following PHP code?
<?php
function timesTwo($int) {
$int = $int * 2;
}
$int = 2;
$result = timesTwo($int);
?>;
Answer: NULL
Question 6
The code below ___________ because ____________.
<?php
class Foo {
?>
<?php
function bar() {
print "bar";
}
}
?>
A) will work, class definitions can be split up into multiple PHP blocks.
B) will not work, class definitions must be in a single PHP block.
C) will not work, class definitions must be in a single file but can be in multiple PHP blocks.
D) will work, class definitions can be split up into multiple files and multiple PHP blocks.
Question 7
When turned on, ____________ will _________ your script with different variables from HTML forms and cookies.
A) show_errors, enable
B) show_errors, show
C) register_globals, enhance
D) register_globals, inject
Question 8
What will be the output of the following PHP code:
<?php
echo count(strlen("http://php.net");
?>
Answer: 1
Question 9
What is the best all-purpose way of comparing two strings?
A) Using the strpos function
B) Using the == operator
C) Using strcasecmp()
D) Using strcmp()
Question 10
What is the difference between "print()" and "echo()"?
Answer: print is a function,echo is a language construct

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2011-01-27 22:13 |只看該作者

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2011-01-28 02:27 |只看該作者

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2011-01-28 10:03 |只看該作者
狗日的,出點(diǎn)實(shí)用的行不

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2011-01-28 10:25 |只看該作者
學(xué)習(xí)

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2011-01-28 14:55 |只看該作者
看了TX的,我是肯定沒戲了!

論壇徽章:
13
CU大牛徽章
日期:2013-03-14 14:14:082016科比退役紀(jì)念章
日期:2016-07-22 11:15:35數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2016-05-27 06:20:002015亞冠之吉達(dá)阿赫利
日期:2015-08-05 10:06:542015年亞洲杯之韓國(guó)
日期:2015-04-01 16:05:42雙魚座
日期:2014-11-13 11:04:24丑牛
日期:2014-07-25 17:29:54子鼠
日期:2014-04-25 12:25:45丑牛
日期:2014-04-17 08:35:48巨蟹座
日期:2014-04-16 16:50:05CU大;照
日期:2013-03-14 14:14:29CU大牛徽章
日期:2013-03-14 14:14:26
7 [報(bào)告]
發(fā)表于 2011-01-31 21:09 |只看該作者
看看

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2011-02-01 09:35 |只看該作者

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2011-02-01 14:28 |只看該作者
好東西呀

論壇徽章:
0
10 [報(bào)告]
發(fā)表于 2011-02-10 08:51 |只看該作者
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP