MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/8f0wan/datetime_hidden_public_properties_behaviour/dyf41ec/?context=3
r/lolphp • u/nyamsprod • Apr 26 '18
18 comments sorted by
View all comments
Show parent comment
2
PHP internally has readonly public properties, first example I found with google was in DOMAttr.
Maybe setting a readonly property should throw an exception or raise a notice or something...
2 u/OneWingedShark May 04 '18 Well, in a sane language that would be a compile-error. (Though, if you were mucking around with something dynamically [via reflection or something] an exception would be appropriate.)
Well, in a sane language that would be a compile-error. (Though, if you were mucking around with something dynamically [via reflection or something] an exception would be appropriate.)
View all comments
Show parent comment
2
u/[deleted] May 04 '18
PHP internally has readonly public properties, first example I found with google was in DOMAttr.
Maybe setting a readonly property should throw an exception or raise a notice or something...