Skip to content

Constructor Argument is required.

Thomas Flori requested to merge github/fork/avargas/master into master

Created by: avargas

You shouldn't always have to pass an argument to the constructor, specially when using it along side multiple dynamic files.

Like (just an example

  • bootrap.php - initializes getopt
  • script1_code.php - adds 4 options to bootrap's getopt object
  • script2_code.php - adds 5 options to bootrap's getopt object

so, bootstrap might not add any options by default, but still initializes it.

$ phpunit GetoptTest.php 
PHPUnit 3.5.15 by Sebastian Bergmann.

............fetching rest as operands
.......fetching rest as operands
.fetching rest as operands
..fetching rest as operands
..fetching rest as operands
....

Time: 0 seconds, Memory: 6.75Mb

OK (28 tests, 67 assertions)

Merge request reports