What are some common code smells in the provided PHP script?

One common code smell in the provided PHP script is the use of global variables, which can lead to unexpected behavior and make the code harder to maintain. To solve this issue, it's recommended to avoid using global variables and instead pass variables as parameters to functions or use classes and objects to encapsulate data.

// Before
$globalVariable = 10;

function someFunction() {
    global $globalVariable;
    echo $globalVariable;
}

someFunction();

// After
$globalVariable = 10;

function someFunction($variable) {
    echo $variable;
}

someFunction($globalVariable);