So PHP is a language that collects and processes the data and provides a result, so it does not have native cron functions and should not even try to mock it for it to have it. (That is, it processes the data that it has to process and it dies soon after)
Well, now your operating system is different, it can create check a file regularly (crontab) and execute certain statement as specified.
Exemplifying:
# [Quando vai rodar] [Comando que vai rodar]
* 1 * * * php /var/www/site/public/index.php --module=z --action=y
That is, I specified that the command "/var/www/site/public/index.php --module = z --action = y" will run every day at 1 o'clock.
Anyway, configuration may change depending on the operating system, so I recommend that you learn the concept ( link ) of a cron, and apply according to your system.