get_current_user

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets the name of the owner of the current PHP script
<?php get_current_user(): string
<?php                 $name = $_SERVER['USERNAME'] . '/' . $name;

            } elseif (!empty($_SERVER['USER'])) {

                $name = $_SERVER['USER'] . '/' . $name;

            } elseif (get_current_user()) {

                $name = get_current_user() . '/' . $name;

            } else {
<?php             } elseif (!empty($_SERVER['USER'])) {

                $name = $_SERVER['USER'] . '/' . $name;

            } elseif (get_current_user()) {

                $name = get_current_user() . '/' . $name;

            } else {


                $name .= '/' . $name;
<?php     private function assertCommonServerVariables(array $response, array $expectedGlobalVariables): array

    {

        $expectedCommonVariables = [

            'USER' => get_current_user(),

            'SERVER_PROTOCOL' => 'HTTP/1.1',

            'SERVER_NAME' => 'localhost',

            'SERVER_ADDR' => '127.0.0.1',