Original text:
Я не знаю ответа, но могу предположить что разница в методе передачи значения.
В первом примере Вы передаете по значению, а во втором по ссылке.
Google translate:
I do not know the answer, but I can assume that the difference is in the method of passing the value.
In the first example, you pass by value, and in the second, you pass by reference.