I have searched a while here on meta but wondered why I can't find an answer. I would like to know why it is not allowed to link to phpfiddle in an answer on Stack Overflow.

I could imagine that it isn't allowed because the elementary part of the answer should be on Stack Overflow and not on an external, maybe unreliable, resource. But sometimes it is really useful if the whole code is just to much to post or will divert from the answer itself, and is not so important but additionally nice to have.

Also I think I remember that links to other sites like phpfiddle (e.g. codepad, jsfiddle or sqlfiddle) are allowed.

  • 6
  • @Mat Thanks! will read that (seems a lot of text) If I'm happy with the answers I'll delete this post
    – hek2mgl
    May 8, 2013 at 13:18
  • @Mat. As I said I encountered this is on a post with much effort and text and an additional link to phpfiddle
    – hek2mgl
    May 8, 2013 at 13:22
  • "much effort and text and" - you need code too
    – Mat
    May 8, 2013 at 13:22
  • @hek2mgl: phpfiddle links are allowed. Low quality posts are not.
    – user7116
    May 8, 2013 at 13:23
  • I had code and text definitely. Maybe not enough code. But excuse me, the problem was just a single line in a bug bunch of code. :) But I now saw the discussion below the accepted answer there. Seems that I'm not alone :)
    – hek2mgl
    May 8, 2013 at 13:24
  • @Jim Thanks for fixing my grammar. I really appreciate to learn from that
    – hek2mgl
    May 8, 2013 at 13:42

2 Answers 2


The code for a question should be short enough to reproduce the problem. It shouldn't be any longer than that.

Code should be a 'point in time'. Code should (as you mention) be in the post so that if an external link goes down or changes, the question doesn't become useless.

You can always post a PHPfiddle or JSFiddle link as supplementary.

Major problems with JSFiddle (et.al.) include:

  • Impermanence: Those links die. Those sites go down. Authors change their fiddles.
  • Carte Blanche for the user to post a wall of code.
  • Yet another hoop a user has to jump through to see an answer

Answers and questions should not use an external link as their primary source.

If a person visiting your question or answer can't just use the question or answer to solve their problem, that's an issue. As a moderator, I'll comment on or (more likely) delete posts that do not conform to these rather simple guidelines.

  • I'm with you with all what you said +1, but today I encountered a strange problem with that. I had code (an xpath query) and some text. And below a link to phpfiddle, where users could try it with the real (big) xml data. The fact that it was not accepted made me a little bit unhappy as it took some effort to prepare the fiddle
    – hek2mgl
    May 8, 2013 at 13:28
  • 2
    @hek2mgl The crucial point is that you should only include enough code and data necessary to reproduce the problem. I find it hard to believe that the XML couldn't have been condensed down to that which reproduces the issue. It may have been more work for you, but it also means it's easier for others to follow. May 8, 2013 at 13:30
  • Will take your advice, reducing the example xml to it's basics, in account in upcoming posts. Unfortunately I cannot reproduce my issue from today for you here. I encountered this the first time. Will play around with and find the required amount of code ;) However, now I know that the links are ok but must be substantiated with enough text and code. thanks for your answer and the discussion!
    – hek2mgl
    May 8, 2013 at 13:36
  • @hek2mgl Also, your CV in your profile 404s because it links directly to your edit page, and not your public CV URL. May 8, 2013 at 14:01
  • Edited it yesterday, and tested it poorly. Will update! thanks, that was nice! Updated the link. If you are searching for developers .... :)
    – hek2mgl
    May 8, 2013 at 14:05
  • is there any chances to provide phpfidle in so question only?
    – user12345
    Aug 5, 2016 at 12:47
  • how is that possible to share a phpfiddle project?
    – csandreas1
    Mar 26, 2018 at 18:46

The links to PhpFiddle are allowed, but make sure, that you write some code in your answer, because external sites can't be relied on. So if the external site is not accessible, a reader of your answer must have the same code available on Stack Overflow. Otherwise, your answer in this case is of no use.

The fiddle has to be just to support your answer in the form of a demo of your code.

For example, see Rab Nawaz's answer to Getting in trouble while splitting a string in PHP.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .