HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-210 months agoWhy make it complicated?lemmy.mlimagemessage-square123linkfedilinkarrow-up1367arrow-down137file-textcross-posted to: [email protected]
arrow-up1330arrow-down1imageWhy make it complicated?lemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-210 months agomessage-square123linkfedilinkfile-textcross-posted to: [email protected]
minus-squareHiddenLayer555@lemmy.mlOPlinkfedilinkEnglisharrow-up6·10 months agoTIL PHP has statics. Also, does PHP actually enforce the type declarations? I’d assume it would but knowing PHP…
minus-squaredan@upvote.aulinkfedilinkarrow-up4·10 months agoIt enforces scalar types (string, int, etc) at runtime if you enable strict mode. There’s also static analysis tools like PHPStan and Psalm that will flag issues at build time.
minus-squareWhyJiffie@sh.itjust.workslinkfedilinkEnglisharrow-up1·10 months agoso, no. good catch OP!
TIL PHP has statics.
Also, does PHP actually enforce the type declarations? I’d assume it would but knowing PHP…
It enforces scalar types (string, int, etc) at runtime if you enable strict mode. There’s also static analysis tools like PHPStan and Psalm that will flag issues at build time.
so, no. good catch OP!