Why doesn't PHP's Autoload feature work in CLI mode?

后端 未结 3 1789
無奈伤痛
無奈伤痛 2021-01-17 22:46

This is more for my own personal edification than anything else but, this is something that has always bothered me: Why specifically can\'t PHP perform \"autoloading\" while

3条回答
  •  一个人的身影
    2021-01-17 22:55

    I would say, they aren't talking about CLI they are talking about PHP interactive mode, aka php -a.

    And why? Because it is only for testing purposes and short snipplets and if ANYTHING is autoloaded the behavior might be crazy.

    http://www.php.net/manual/en/features.commandline.interactive.php

提交回复
热议问题