DonjonMaister to Programmer [email protected] • 1 year agoThe difference between an instance variable and a static variable.programming.devimagemessage-square12fedilinkarrow-up175arrow-down15file-textcross-posted to: [email protected]
arrow-up170arrow-down1imageThe difference between an instance variable and a static variable.programming.devDonjonMaister to Programmer [email protected] • 1 year agomessage-square12fedilinkfile-textcross-posted to: [email protected]
minus-square@[email protected]linkfedilink10•1 year agoint variable => local scope => my int from the perspective of an instance static int variable => class scope => our int, for all instances of a class
minus-square@[email protected]linkfedilink1•1 year agoYou know what’s funny? In PHP it’s backwards :D
int variable => local scope => my int from the perspective of an instance
static int variable => class scope => our int, for all instances of a class
You know what’s funny? In PHP it’s backwards :D
well of course it is!