Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question 323 Issue #10

Open
sambwest opened this issue Aug 12, 2021 · 4 comments
Open

Question 323 Issue #10

sambwest opened this issue Aug 12, 2021 · 4 comments

Comments

@sambwest
Copy link
Contributor

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"

@alceanicu
Copy link
Owner

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
Copy link
Owner

alceanicu commented Aug 12, 2021

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.

@sambwest
Copy link
Contributor Author

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

@alceanicu
Copy link
Owner

only A is correct, I will update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants