Explain USE and REQUIREMENT statements?


  • REQUIRE statement: It is used to import functions with a global scope such that their objects and functions can be accessed directly

Example: Require Module,

Var=module::method(); //method called with the module reference

  • USE statements are interpreted and are executed during parsing, while during run time the require statements are executed.

Example: Use Module

Var=method(); //method can be called directly


© 2017