SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    633
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Where Can I Test PHP Code Online

    Sitepoint Members,
    Where can I test PHP code online. The one site I found gives error messages I can't understand.

    Thanks,

    Chris

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    The ideal would be to get your own hosting, which can cost as little as a few dollars a month. Or you could set up a server environment on your own computer, using something like WAMP (PC) or MAMP (Mac), both of which are free.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    633
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ralph,
    I forgot to think of "validator". I found a php validator.

    PHPLint on-line

    Thanks,

    Chris

  4. #4
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    69 Post(s)
    Tagged
    0 Thread(s)
    Which is an okay tester for syntax of an individual file. *AMPing it is usually better for testing purposes (and faster than having to FTP to a remote site constantly ), because you have direct access to php.ini and can turn error reporting on by default.

  5. #5
    SitePoint Zealot Sogo7's Avatar
    Join Date
    May 2011
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Why not get yourself some free webspace with the likes of X10Hosting or 000Webhost, both have good support forums to answer any technical problems you may encounter.

  6. #6
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by StarLion View Post
    Which is an okay tester for syntax of an individual file. *AMPing it is usually better for testing purposes (and faster than having to FTP to a remote site constantly ), because you have direct access to php.ini and can turn error reporting on by default.
    Not so sure about that. You still have to create a file, name it, save it, type in the address manually in the browser etc. Most programmers are inherently lazy so it's best to use a site like:
    Free PHP test - free php code testing online. -
    Test run php code online, right here - WriteCodeOnline.com/PHP

    Just type and go!
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.

  7. #7
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Get the best of both worlds, PHP Interactive - an interactive shell for PHP an interactive shell you install on your own machine.

    Used it for years, where I do most much of working out when replying here. Sometimes you don't want to pollute your IDE with snippets of code.

  8. #8
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    69 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tangoforce View Post
    Not so sure about that. You still have to create a file, name it, save it, type in the address manually in the browser etc. Most programmers are inherently lazy so it's best to use a site like:
    Free PHP test - free php code testing online. -
    Test run php code online, right here - WriteCodeOnline.com/PHP

    Just type and go!
    Again; Run PHP code.

    Run this.
    <?php
    include_once('config.php');
    include_once('functions.php');
    include_once('header.php');

    //300 lines of code
    ?>

    Now find me the errors in my code and make sure it comes out with the correct values.

    "You still have to create a file, name it, save it, type in the address manually in the browser"

    And in your example you still have to create a file type in the address manually in your browser...
    and now you have to make it flat, not connect to any database that isnt open to the world connecting to it, have to comply to their server's modules, etc....

    Far more work than just coding the thing and actually running it, imo. But if thats what works for you, by all means go for it.

  9. #9
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I seen an awesome demo of this (BeachPHP) at PHPNW10, brilliant.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  10. #10
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by StarLion View Post
    Again; Run PHP code.

    Run this.
    <?php
    include_once('config.php');
    include_once('functions.php');
    include_once('header.php');

    //300 lines of code
    ?>

    Now find me the errors in my code and make sure it comes out with the correct values.

    "You still have to create a file, name it, save it, type in the address manually in the browser"

    And in your example you still have to create a file type in the address manually in your browser...
    and now you have to make it flat, not connect to any database that isnt open to the world connecting to it, have to comply to their server's modules, etc....

    Far more work than just coding the thing and actually running it, imo. But if thats what works for you, by all means go for it.
    The op asked where they could test php code. Not an entire php system

    When I want to test a bit of code that is reliant on other files, variables etc, i just manually set them up instead and then run the trial code to see how it works with the variables. It's not hard is it.
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.

  11. #11
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trycodeonline.com

    Quote Originally Posted by Chris77 View Post
    Sitepoint Members,
    Where can I test PHP code online. The one site I found gives error messages I can't understand.

    Thanks,

    Chris
    Trycodeonline.com is the place which you are searching for, here you can test your code online or you can save the code for future reference or to share with your friends

  12. #12
    Non-Member
    Join Date
    Apr 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    writecodeonline.com/php is the site to test php code.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •