Sabitlenmiş Tweet

PSA : I'm also available on BluSky bsky.app/profile/dseguy… and mastodon @dseguy" target="_blank" rel="nofollow noopener">phpc.social/@dseguy
English
Damien Seguy (@[email protected])
4.8K posts

@faguo
Code quality fanatic, static analysis expert @exakat, elephpant breeder, husband, father, speaker!https://t.co/bXYI33RdlH




header_register_callback() registers a function that fires just before headers are sent. After ALL your code runs. After ALL output buffering. Before the first byte goes to the client. Last chance to add headers, and last chance to change the status code! There is no later hook in #PHP than this one.




#PHP streams have a built-in notification system. Set a callback in the stream context. Get called on CONNECT, MIME_TYPE, FILE_SIZE, PROGRESS, COMPLETED. Download progress bars. In pure PHP. No curl_setopt. No ReactPHP. This callback has existed since PHP 5.2!


























