Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Fiton012's avatar

How does a watcher works under the hood?

I want to check what is the performance overhead from using this feature.

From the official documentation: "watch is shallow by default: the callback will only trigger when the watched property has been assigned a new value"

However this does not explain how it works under the hood. Does anyone know whether there is some kind of polling mechanism that works every some interval and checks for value changes. If not how exactly it works?

Thanks

0 likes
1 reply

Please or to participate in this conversation.