zce
zce copied to clipboard
Question 323 Issue
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"
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 :)
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.
ok, having answer C is wrong in both versions though - no?
only A is correct, I will update