Php 变量的第一次出现是否有值?

Php 变量的第一次出现是否有值?,php,Php,我从github下载了一些文件(如果有必要的话,从) 这是php登录的东西,一切都正常,但我不明白这是怎么可能的 这是我页面的典型顶部 require('inc/config.php'); // db credentials and connect require('inc/password.php'); // class password, hashing etc require('inc/user.php'); // class user user.php中的第一个函数如下: ... pr

我从github下载了一些文件(如果有必要的话,从)

这是php登录的东西,一切都正常,但我不明白这是怎么可能的

这是我页面的典型顶部

require('inc/config.php'); // db credentials and connect
require('inc/password.php'); // class password, hashing etc
require('inc/user.php'); // class user
user.php
中的第一个函数如下:

...
private function get_user_hash($username){  

    $_SESSION["uname"] = $username; // echo of this variable works
...
所以,问题是,
$username
的值来自哪里

因为前面的文件(
config.php
password.php
)中没有这样的变量


这是它在整个脚本工作流中的第一次出现,它有什么价值

$username
get\u user\u hash
函数的一个参数,只有在脚本中的其他地方出现一些代码后才会执行该函数。尽管它首先出现,但它并不是首先运行的,调用此函数的代码将为它传递一个值,该值为
$username

find from where get_user_hash(),它们将是其中的某个参数。不必将其命名为$username。
前-


谢谢。所有的答案都帮助了我。解决了(我希望)
  $user="some user name";
  get_user_hash($user);