What are the best practices for handling conflicts with superiors over the ownership and sharing of PHP code in a work environment?

When conflicts arise with superiors over the ownership and sharing of PHP code in a work environment, it is important to communicate openly and respectfully. Clearly define ownership rights and responsibilities in a written agreement or policy. Collaborate with superiors to find a compromise that satisfies both parties and ensures the smooth sharing and usage of PHP code.

// Example PHP code snippet for defining ownership rights and responsibilities

/**
 * Function to calculate the sum of two numbers
 * 
 * @param int $num1 First number
 * @param int $num2 Second number
 * @return int Sum of the two numbers
 */
function calculateSum($num1, $num2) {
    return $num1 + $num2;
}

// Define ownership rights and responsibilities
// This code snippet is the intellectual property of [Your Company Name]
// Sharing or modification of this code without permission is prohibited