zce icon indicating copy to clipboard operation
zce copied to clipboard

Question 323 Issue

Open sambwest opened this issue 3 years ago • 4 comments

Hi,

I think there is an issue with question 323.

https://github.com/alceanicu/zce/blob/master/questions/0323.md


What is the output of the following PHP script?

$string1 = 'foo' . 'bar';
$string2 = 'hello' + 'goodbye';
$string3 = "abc" + "123";

echo sprintf('%s - %s - %s', $string1, $string2, $string3);
Enter the exact script output

 A) foobar - 0 - 123
 B) 0
 C) foo
 D) bar
 
Answer
Answer: A, C

PHP < 8 Output: "foobar - 0 - 123" - Answer A PHP 8 Output: "Fatal error: Uncaught TypeError: Unsupported operand types"

sambwest avatar Aug 12 '21 09:08 sambwest

Hi, your remark is correct.

Question is correct only for PHP 7, and this because the exam questions are based on PHP 7.1 version.

see ZEND EXAM FAQ!

let`s hope the exam will be update to version 8 soon :)

alceanicu avatar Aug 12 '21 09:08 alceanicu

TODO - update for PHP8 TODO - in version 4.0.0 to add a version tag (PHP5, PHP7, PHP8 ...) to refer for what version question refers.

alceanicu avatar Aug 12 '21 09:08 alceanicu

ok, having answer C is wrong in both versions though - no?

sambwest avatar Aug 12 '21 09:08 sambwest

only A is correct, I will update

alceanicu avatar Aug 12 '21 09:08 alceanicu