DonjonMaister to Programmer Humor@lemmy.ml • 1 year agoThe difference between an instance variable and a static variable.programming.devimagemessage-square8fedilinkarrow-up129arrow-down10file-textcross-posted to: programmer_humor@programming.dev
arrow-up129arrow-down1imageThe difference between an instance variable and a static variable.programming.devDonjonMaister to Programmer Humor@lemmy.ml • 1 year agomessage-square8fedilinkfile-textcross-posted to: programmer_humor@programming.dev
minus-square@fiah@discuss.tchncs.delinkfedilink0•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@Bear_with_a_hammer@lemmy.mllinkfedilink1•1 year agoYou know what’s funny? In PHP it’s backwards :D
Young man, could.you explain your shitpost?
I said, young man, what the fuck was that post?
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!