There are several options you have:
Polling
This is the first option you mentioned. A client has to request every x time units to ask for updates. This results in many requests. Just think about 100 users that asks for updates every second, this results in 6000 requests per minute. In many cases it will happen that the requests queue and it's not real time anymore.
Long Polling
Here the client sends a request and the on the server you have a loop which checks for updates (somehow like your second example). The respond will be send as soon as there is an update. This results in many parallel threads to handle for the server. 100 users makes 100 threads …
Both solutions are not optimal. Instead we should use a persistent connection for the communication.
There are two options for persistent connections:
Web Sockets
WebSockets provide a persistent connection between a client and server that both parties can use to start sending data at any time. In the end this an event loop, but you don't have to care about this. Advantage is, that this is another protocol that is specialised on real time connections! WebSockets are event-based, so it's just using only one thread.
Server Sent Events
It's very similar to WebSockets. You open a persistent connection on clientside to the server, but over HTTP. Main difference is that SSE connections can only push data to the client.
Conclusion
So in practice: Since everything that can be done with SSE can also be done with WebSockets and the browser support for WebSockets is much better than for SSE, I think this is the best option you can go with.
For example: IE / Edge supports WebSockets but not SSE
Maybe you could use Ratchet as a framework for WebSockets for PHP:
http://socketo.me/
But I have to give you the hint that PHP is not made for heavy real time applications. It's that your use-case, maybe you should use node.js for backend since JavaScript is naturally event-based to fit such use-cases.