Achieving real-time notification of database updates in PHP without polling

I have a php script which will update a database when a user enters some text into the site. I want to also send an update so that a different online user will be notified about this. If possible it’d be nice to use only core php. I don’t really want to use a polling-like method. What other ways are there to achieve this?

Would semaphores or shared memory be an option? If so then how would that work? Or is using websockets a better choice for my use case?