How can one prevent users from editing or removing a copyright notice in a PHP script?

To prevent users from editing or removing a copyright notice in a PHP script, you can use PHP's `__halt_compiler()` function in combination with file locking. This function stops the execution of the script at the point where it is called, preventing any further code from being executed. By placing the copyright notice at the beginning of the script and calling `__halt_compiler()` immediately after it, you can ensure that the notice cannot be edited or removed by users.

<?php
// Copyright notice
echo "Copyright © 2022 My Company. All rights reserved.";

// Halt the compiler to prevent further execution
__halt_compiler();