What is the output of the following code?

What is the output of the following code? class Base { protected static function whoami() { echo "Base "; } public static function whoareyou() { static::whoami(); class A extends Base { public static function test() { Base::whoareyou(); } self::whoareyou(); parent::whoareyou(); A::whoareyou(); static::whoareyou(); public static function whoa mi() { echo "A";...

March 29, 2018 No Comments READ MORE +

Which function can NOT help prevent cross-site scripting? (Choose 2)

Which function can NOT help prevent cross-site scripting? (Choose 2)A . addslashes()B . htmlentities()C . htmlspecialchars()D . strip_tags()E . quotemeta()View AnswerAnswer: A, E

March 28, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? $f = function () { return "hello";}; echo gettype($f);A . helloB . stringC . objectD . functionView AnswerAnswer: C

March 26, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? function increment (&$val) { return $va I + 1; $a= 1; echo increment ($a); echo increment ($a);View AnswerAnswer: 22

March 16, 2018 No Comments READ MORE +

Given the following code, what will the output be:

Given the following code, what will the output be: trait MyTrait { } private $a be = 1; public function increment() { $this->abc++; } public function getValue() { return $th is->abc; class MyClass { use MyTrait; public function incrementBy2() { $th is->i ncre m ent(); $this->abc++; $c = new MyClass;...

March 15, 2018 No Comments READ MORE +

What is the output of this code?

What is the output of this code? $world = 'world'; echo <<<'TEXT' hello $world TEXT;A . hello worldB . hello $worldC . PHP Parser errorView AnswerAnswer: C

March 12, 2018 No Comments READ MORE +

Which of the following configurations could be responsible for this outcome?

Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following configurations could be responsible for this outcome? (Choose 2)A . The PHP configuration option post_max_size is set to...

March 10, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? A . 1B . 2C . nullView AnswerAnswer: A

March 10, 2018 1 Comment READ MORE +

What is the output of the following code?

What is the output of the following code? A . string(0) '"'B . bool(false)C . string(l) "!"D . string(2) "k!"View AnswerAnswer: C

March 7, 2018 1 Comment READ MORE +

Given the following code, what is correct?

Given the following code, what is correct? function f(stdClass &$x = NULL) { $x = 42;} $z = new stdClass; f($z); var _dump($z);A . Error: Typehints cannot be NULLB . Error: Typehints cannot be referencesC . Result is NU LLD . Result is object of type stdClassE . Result is...

March 5, 2018 No Comments READ MORE +