- file_get_contents: documentation ( source)
- var_dump: documentation ( source)
- register_shutdown_function: documentation ( source)
- file_put_contents: documentation ( source)
<?php
register_shutdown_function ('shutdown');
file_put_contents ('/tmp/test.txt', "main 1 \n", FILE_APPEND | LOCK_EX);
file_put_contents ('/tmp/test.txt', "main 2 \n", FILE_APPEND | LOCK_EX);
function shutdown () {
file_put_contents ('/tmp/test.txt', "shutdown 1 \n", FILE_APPEND | LOCK_EX);
file_put_contents ('/tmp/test.txt', "shutdown 2 \n", FILE_APPEND | LOCK_EX);
var_dump(file_get_contents("/tmp/test.txt"));
exit;
}