|  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:
Solve the problem:
11 + 48 = ?
Subscribe to this entry?

 [2005-03-23 21:47 UTC] sam_bravard at yahoo dot com
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:


php -run TTester TObject.php [args]

Which would call the main() in TTester:


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.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-29 07:14 UTC]
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: krakjoe
 [2013-10-29 07:14 UTC]
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-2023 The PHP Group
All rights reserved.
Last updated: Thu Jan 26 22:05:54 2023 UTC