Glad that you clarified the best way to handle __set for asymmetric visibility rfc. Now it's not just a write-limitation that errors (how I perceived you intended it and also how readonly is right now) but more of a full fledged asymmetric visibility.
Thought about it a bit more and I still think an error might be simpler for now.
It's not at all clear what $obj->intProp++ should do and how will this be different that $obj->intProp += 1.
And, also, I am not completely convinced that __set() is really needed for a real use case that exists right now except for the aparent consistency. I am worried that it might be used more that it should and the user land code would just get more complex to understand than it really needs to.
@AlexP using __get and __set to provide poor man’s set accessor/hook (ie a public property that has checks on set operations) is a common pattern.
Avis allows the boilerplate __get to be dropped and the property becomes a regular one for gets.
Pretty much most scenarios that property accessors/hooks is meant to provide, __set/__get can provide now, it’s just “uglier” and less obvious. I’m in favour of the hooks rfc (comments above notwithstanding) but making current usable behaviour “unsupported” when it’s not hard to support it is a shitty deal
hello guys, I'm trying to open a popup instead of new tab the popup works, but my code still open new tab along with the popup is there something wrong here?
function pop_up(url){ window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=1076,height=768,directories=no,location=no') }
You have to pass event itself to JS function function pop_up(this, e) { e.preventDefault()//which prevents browser's default behavior //rest of JS code }