MARDEN
Новичок
Задачи из онлайн теста по PHP 5
На днях удалось получить доступ к одному известному онлайн тесту. Столкнулся с некоторыми вопросами, на которые не удалось ответить со 100%-й уверенностью. Поэтому прошу откликнуться мастеров php дабы помочь решить некоторые задачи и развеять сомнения.
Примечания:
- Там, где нет пометок, нужно выбрать один вариант. В других случаях, если отмечено, может быть несколько правильных ответов или требуется самому вписать ответ.
- Огромная просьба всем откликнувшимся аргументировать свои ответы.
1(1). When implementing a permissions system for your Web site, what should always be done with regards to the session?
A. None of the above
B. You should not implement permission systems using sessions
C. Sessions should be cleared of all data and re-populated
D. The session key should be regenerated
E. The session should be destroyed
2(12). When running PHP in a shared host environment, what is the major security concern when it comes to session data?
A. Sessions on shared hosts are easily hijacked by outside malicious users
B. All of the above
C. You cannot use a custom data store in shared hosts
D. Session data stored in the file system can be read by other scripts on the same shared host
E. Users outside the shared host can access any site which created a session for them
3(20). Consider the following series of classes and interfaces
MyClass2 is an example of the ________ design pattern.
Вписать нужный ответ.
4(21). The ____ construct is particularly useful to assign your own variable names to values within an array.
A. array_get_variables
B. current
C. each
D. import_variables
E. list
5(41). Which from the following list is not an approrpiate use of an array?
A. As a list
B. All of these uses are valid
C. As a Lookup Table
D. A Stack
E. As a hash table
6(46). Which of the following are examples of the new engine executor models available in PHP 5?
Выбрать 3 ответа.
A. Switch
B. Conditional
C. Goto
D. Call
E. Dynamic
7(55). The _________ context variable allows you to define a callback for the stream that will notify your script of certain events during the course of the transaction.
Вписать нужный ответ.
8(59). The ________ function is used to generate a file resource in the file system with a randomly-generated filename to be used as temporary storage
Вписать нужный ответ.
9. The _________ pattern is useful for an object which can be traversed as a list, implemented in PHP by an interface of the same name.
Вписать нужный ответ.
Заранее спасибо!
На днях удалось получить доступ к одному известному онлайн тесту. Столкнулся с некоторыми вопросами, на которые не удалось ответить со 100%-й уверенностью. Поэтому прошу откликнуться мастеров php дабы помочь решить некоторые задачи и развеять сомнения.
Примечания:
- Там, где нет пометок, нужно выбрать один вариант. В других случаях, если отмечено, может быть несколько правильных ответов или требуется самому вписать ответ.
- Огромная просьба всем откликнувшимся аргументировать свои ответы.
1(1). When implementing a permissions system for your Web site, what should always be done with regards to the session?
A. None of the above
B. You should not implement permission systems using sessions
C. Sessions should be cleared of all data and re-populated
D. The session key should be regenerated
E. The session should be destroyed
2(12). When running PHP in a shared host environment, what is the major security concern when it comes to session data?
A. Sessions on shared hosts are easily hijacked by outside malicious users
B. All of the above
C. You cannot use a custom data store in shared hosts
D. Session data stored in the file system can be read by other scripts on the same shared host
E. Users outside the shared host can access any site which created a session for them
3(20). Consider the following series of classes and interfaces
PHP:
<?php
interface MyInterface {
public function getTitleAndAuthor();
}
class MyClass {
private $_author;
private $_title;
public function getAuthor() {
_return $this->_author;
}
public function getTitle() {
_return $this->_title;
}
}
class MyClass2 {
private $_instance;
public function __construct(MyClass $a) {
_$this->_instance = $a;
}
public function getTitleAndAuthor() {
_$retval = array(
_ 'title' => $this->_instance->getTitle(),
_ 'author' => $this->_instance->getAuthor()
_);
_return $retval;
}
}
class MyClass3 {
public function doSomething(MyInterface $instance) {
_$value = $instance->getTitleAndAuthor();
}
}
?>
Вписать нужный ответ.
4(21). The ____ construct is particularly useful to assign your own variable names to values within an array.
A. array_get_variables
B. current
C. each
D. import_variables
E. list
5(41). Which from the following list is not an approrpiate use of an array?
A. As a list
B. All of these uses are valid
C. As a Lookup Table
D. A Stack
E. As a hash table
6(46). Which of the following are examples of the new engine executor models available in PHP 5?
Выбрать 3 ответа.
A. Switch
B. Conditional
C. Goto
D. Call
E. Dynamic
7(55). The _________ context variable allows you to define a callback for the stream that will notify your script of certain events during the course of the transaction.
Вписать нужный ответ.
8(59). The ________ function is used to generate a file resource in the file system with a randomly-generated filename to be used as temporary storage
Вписать нужный ответ.
9. The _________ pattern is useful for an object which can be traversed as a list, implemented in PHP by an interface of the same name.
Вписать нужный ответ.
Заранее спасибо!