|  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.
Block user comment
Status: Assign to:
Bug Type:
From: sam_bravard at yahoo dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 08:01:27 2024 UTC