php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32435 Add '-run' option to php command line (like java -jar)
Submitted: 2005-03-23 21:47 UTC Modified: 2013-10-29 07:14 UTC
From: sam_bravard at yahoo dot com Assigned: krakjoe (profile)
Status: Closed Package: *General Issues
PHP Version: 5.0.3 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sam_bravard at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-03-23 21:47 UTC] sam_bravard at yahoo dot com
Description:
------------
Seems to me it would be great if the php5 command line tool ('php') had an option to run a static main() method of a specified class just like java does:

eg:

php -run TTester TObject.php [args]

Which would call the main() in TTester:

TObjectToTest.php:

class TObjectToTest
{
   // ... class that we'll want to test
}

class TTester {

  public static main($args)
  {
     // execute tests on TObjectToTest
  }
}

This would be particularly good for making it easy to bundle  and run tests on each individual php file.

Thoughts?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-29 07:14 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: krakjoe
 [2013-10-29 07:14 UTC] krakjoe@php.net
PHP has no concept of main(), and it would be confusing to try to introduce one at this point.

Closing the request.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC