jjzjj

globalAllTheThings

全部标签

php - 为 "$GLOBALS"构造的可变变量字符串在全局范围内工作,但不在函数范围内

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