DonjonMaister@programming.dev to Programmer Humor@lemmy.ml · 2 years agoThe difference between an instance variable and a static variable.programming.devimagemessage-square8fedilinkarrow-up122arrow-down10file-text
arrow-up122arrow-down1imageThe difference between an instance variable and a static variable.programming.devDonjonMaister@programming.dev to Programmer Humor@lemmy.ml · 2 years agomessage-square8fedilinkfile-text
minus-squareLux@lemmy.blahaj.zonelinkfedilinkarrow-up1·2 years agoI said, young man, what the fuck was that post?
minus-squarefiah@discuss.tchncs.delinkfedilinkarrow-up0·2 years 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-squareBear_with_a_hammer@lemmy.mllinkfedilinkarrow-up1·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!