<pre>
<?php

$cmd = 'perl zor 2>&1';

/* =========================
 * shell_exec()
 * ========================= */
if (function_exists('shell_exec')) {
    echo "=== shell_exec output ===\n";

    $output = shell_exec($cmd);

    if ($output === null) {
        echo "shell_exec is disabled or command failed.\n";
    } else {
        echo $output;
    }
} else {
    echo "shell_exec() is disabled on this server.\n";
}

echo "\n";

/* =========================
 * exec()
 * ========================= */
if (function_exists('exec')) {
    echo "=== exec output ===\n";

    $output = [];
    $returnVar = 0;

    exec($cmd, $output, $returnVar);

    if ($returnVar !== 0) {
        echo "Command failed with status {$returnVar}\n";
    } else {
        foreach ($output as $line) {
            echo $line . "\n";
        }
    }

    echo "Exit status: {$returnVar}\n";
} else {
    echo "exec() is disabled on this server.\n";
}

echo "\n";

/* =========================
 * system()
 * ========================= */
if (function_exists('system')) {
    echo "=== system output ===\n";

    $returnVar = 0;
    system($cmd, $returnVar);

    echo "\nExit status: {$returnVar}\n";
} else {
    echo "system() is disabled on this server.\n";
}

echo "\n";

/* =========================
 * passthru()
 * ========================= */
if (function_exists('passthru')) {
    echo "=== passthru output ===\n";

    $returnVar = 0;
    passthru($cmd, $returnVar);

    echo "\nExit status: {$returnVar}\n";
} else {
    echo "passthru() is disabled on this server.\n";
}

echo "\n";

/* =========================
 * disabled_functions check
 * ========================= */
echo "=== PHP Configuration ===\n";

$disabled = ini_get('disable_functions');

if (!empty($disabled)) {
    echo "Disabled functions:\n";
    echo $disabled . "\n";
} else {
    echo "No disabled functions listed in disable_functions.\n";
}

?>
</pre>
