This will always be 1 as it's an assignment not an increment.
If you do x+=
1 without initializing, it will throw an error.
This happened as during the compiler run, value of b was already defined as 12 in sequence of code. (It is not a reference that will be updated if x changes later). For more clarity, have updated your code to show how execution happened and values of variables were being used:
Output for it is:
You can see the value of x did change to 15 before the function call (even x value is 15 inside), but the value of b was set to 12 as it was the case when the function definition was setup in execution.