Animportantnote:$GLOBALSaredirtyandevil.Don'tusethem.Ever.Nevereverever.Pleasefocusonthefactthatitdoesn'tworkandnotwhyyouwouldbedoingthisinthefirstplace,itispurelyatheoreticalquestionaboutatechnicalexercise.这是一个相当奇怪的。我正在尝试使用名为$GLOBALS的字符串构造一个可变变量。来自全局范围让我们看看在全局范围内使用var_dump()时会得到什么。$g=sprintf('%