In order to create an object storage where each object would be stored only once, you may use which of the following? (Choose 2)

In order to create an object storage where each object would be stored only once, you may use which of the following? (Choose 2)A . SplFixedArrayB . SplObjectStorageC . SplStringD . spl_object_hash E: spl_same_objectView AnswerAnswer: B, D

June 13, 2018 No Comments READ MORE +

return isset($this) ?

What is the output of the following code? class Number { private $v = 0; public function _construct($v) { $this->v = $v; } public function mul() { return function ($x) { return $this->v * $x; }; $one = new Number(l); $two= new Number(2); $double = $two->mul()->bindTo($one); echo $double(S); class Number...

June 10, 2018 No Comments READ MORE +

Which constant must be passed as the second argument to htmlentities() to convert single quotes (') to HTML entities?

Which constant must be passed as the second argument to htmlentities() to convert single quotes (') to HTML entities?A . TRUEB . FALSEC . ENT_QUOTESD . ENT_NOQUOTESE . ENT_COMPATView AnswerAnswer: C

June 9, 2018 No Comments READ MORE +

What can prevent PHP from being able to open a file on the hard drive (Choose 2)?

What can prevent PHP from being able to open a file on the hard drive (Choose 2)?A . File system permissionsB . File is outside of open_basedirC . File is inside the /tmp directory.D . PHP is running in CGI mode.View AnswerAnswer: A, B

June 6, 2018 No Comments READ MORE +

When would you use classes and when would you use namespaces?

When would you use classes and when would you use namespaces?A . Use classes to encapsulate code and represent objects, and namespaces to avoid symbol name collisionsB . Use classes for performance-sensitive code, and namespaces when readability matters moreC . Use namespaces for performance-sensitive code, and classes when readability matters...

June 6, 2018 No Comments READ MORE +

Late static binding is used in PHP to:

Late static binding is used in PHP to:A . Load dynamic libraries and extensions at runtimeB . Use caller class information provided in static method callC . Resolve undefined class names by automatically including needed filesD . Find proper method to call according to the call argumentsView AnswerAnswer: B

June 2, 2018 No Comments READ MORE +

What does the _FILE_ constant contain?

What does the _FILE_ constant contain?A . The filename of the current script.B . The full path to the current script.C . The URL of the request made.D . The path to the main script.View AnswerAnswer: B

June 1, 2018 No Comments READ MORE +

Which of the following is true about stream contexts? (Choose 2)

Which of the following is true about stream contexts? (Choose 2)A . A context can modify or enhance the behavior of a streamB . A context indicates what session the stream is part ofC . A context is a set of parameters and stream wrapper specific optionsD . Contexts are...

May 27, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? class test { } public $value= 0; function test() { $this->value = 1; } function _construct() { $this->value = 2; $object = new test(); echo $object->value;A . 2B . 1C . 0D . 3E . No Output, PHP will generate an error...

May 25, 2018 No Comments READ MORE +

What is the result of the following code?

What is the result of the following code? class T canst A = 42 + 1; } echoT::A;A . 42B . 43C . Parse errorView AnswerAnswer: C

May 22, 2018 No Comments READ MORE +