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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
24 + 17 = ?
Subscribe to this entry?

 
 [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 Apr 25 09:01:29 2024 UTC