Could You tell me please, why the result of the code below is not 5 but 6? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 4

Could You tell me please, why the result of the code below is not 5 but 6?

https://code.sololearn.com/wABSm7kc2qUj/?ref=app

20th Aug 2019, 9:30 AM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
2 Réponses
+ 2
If there was a global $b statement above the return statement the output would be 5.
20th Aug 2019, 9:43 AM
Sonic
Sonic - avatar
+ 2
Thank You both
22nd Aug 2019, 7:13 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar