DonjonMaister to Programmer Humor@lemmy.ml · 3 年前The difference between an instance variable and a static variable.imagemessage-square10linkfedilinkarrow-up153arrow-down11file-textcross-posted to: programmer_humor
arrow-up152arrow-down1imageThe difference between an instance variable and a static variable.DonjonMaister to Programmer Humor@lemmy.ml · 3 年前message-square10linkfedilinkfile-textcross-posted to: programmer_humor
minus-squarefiah@discuss.tchncs.delinkfedilinkarrow-up3·3 年前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
minus-squareBear_with_a_hammer@lemmy.mlBannedlinkfedilinkarrow-up2·3 年前You 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!