http://www.osoft.com/store/products/osoft_1490922690php-logo.png

I’m a programmer and I’ve written a few compilers, but maybe my expectations are too high? Here is some PHP code that doesn’t work. But if you report it as a bug as I did they say, “that’s how it’s supposed to work”. I think they think if you document a bug it’s not a bug any more. This is what gives open source a bad name… lack of responsibility.

Here’s the code. Pretty simple stuff

$myarray = array("one","two","three","four");

foreach ($myarray as &$x) {
   $x = "$x -";
   print "$x\n";
}

print "\n";

foreach ($myarray as $x) {
   print "$x\n";
}

You would expect it to print this:

one -
two -
three -
four -
one -
two -
three -
four -

Actual result:

one -
two -
three -
four -

one -
two -
three -
three -

As you can see – not what a reasonable person would expect. Not only am I shocked that PHP fails this simple example, but when I went to report it the response is “that’s not a bug – it’s supposed to do that”. It supports my claim that the VI editor causes brain damage.




  1. mouring says:

    Meh.. missed the “foo();” call after the function call above. =)

  2. Postman says:

    It works properly in php.net you skould ditch the crap freetard version and go with msft version and leave mysql behind as well.

  3. Jägermeister says:

    You get what you paid for.

  4. Marc Perkel says:

    And it’s worth twice what I paid for it.

  5. Hmeyers says:

    #20 for the win

  6. 2akeens says:

    Because if you pay for stuff, every single bug you report gets fixed right away, right? Oh shucks, it doesn’t: https://connect.microsoft.com/SearchResultsLive.aspx?SearchQuery=won't%2bfix

    What you ran into is illogical, but internally consistent behavior. It’s not even clearly a bug. This behavior is being pointed out to you with a workaround readily available. Quit your bitchin’ and start being a developer for crying out loud. You’re free to complain once you write your own perfect, consistent, bug-free, does-what-I-mean, adopted-by-millions-around-the-world platform.

  7. StoopidFlanders says:

    Why don’t you purchase the Microsoft©®™ alternative, call them up, and try and get as much info on their product as #20 has provided about your issue, to you for free. Good luck with that.

  8. qb says:

    Having a rough day Marc? I use open source software all the time and it works great. I also use great commercial software all the time. There is a lot of software I don’t use because it’s crap – commercial and OSS.

    unset the damn variable, or at least scope it. Spend a few bucks on a decent editor or IDE (Textmate, Slickedit, or anything from JetBrains). Read some poetry, drink some wine, and dance with a beautiful woman.

    BTW, I assume your test coverage is high, your build is flawless, and your deploys roll out and back automatically? Right?

  9. jbellies says:

    #20 If the syntax is incorrect, perhaps the compiler should return an error message (option 3). But let me guess … it isn’t a compiler?

    Inconsistent behaviour (gotcha’s) has long been a bugbear of much software. Sometimes I wish we could just restart. But Marc hasn’t demonstrated that closed-source software is better in this regard. The inconsistencies do help keep IT people employed; too bad they haven’t figured out how to write themselves million-dollar bonus cheques like the Wall Street people do.

  10. amodedoma says:

    Open Source doesn’t have the support resources that M$ has – WHOA – big surprise. Frackin’ pinhead, what exactly were you expecting? You want better but don’t want to pay for it? You pirate M$, just like everybody else.

  11. Travis says:

    I guess you never worked with Oracle or Cisco. They sell insanely expensive support contracts that come with special phone numbers to call 24/7 and weekly review meetings where an engineer will tell you that the product is working as designed or that this bug will be fixed in the next release. The simple truth is that bugs happen, and you have to deal with them.

  12. cgp says:

    I would not call that a bug unless the non use of the ‘&’ in the parameter is not the correct calling usage.

    I would call it a flaw that should not have been allowed. This side effect seems to be something simple, and if it is a result of something complex then php implementation is way over complex for such simple actions.

    Or as the author points out it is lack of professional quality control (in a big way).

    This is not half of my objection to open source. I believe it to be a scam to get something for nothing. So much time and blood and sweat is expended for code creation that the call for freely giving it away under the pretension that it is the current business practice further convinces me that software engineering today is a mugs game. E.g., 100,000 iphone coders ridiculous, all that creativity put to waste in the rotten Apple app queue.

  13. pedro says:

    Open source sucks. I’m still mad at Opera for all the bugs on the opera 10 installation.

  14. Hmeyers says:

    @ Pedro

    “Open source sucks. I’m still mad at Opera for all the bugs”

    Pedro, you barnacle head — Opera is NOT open source.

  15. 2akeens says:

    @#32

    If OSS is a scam, it seems to work pretty well. We’re running a business on the LAMP stack here, thank you very much.

    And sorry to break it to you, but the App Store is CLOSED SOURCE. You have to pay to run your own software on the iPhone. Bad example there, bad example.

  16. Hmeyers says:

    @32 cgp

    “This is not half of my objection to open source. I believe it to be a scam to get something for nothing.”

    Open source is the idea that human creativity builds atop others works. Medical advancements are shared in the scientific field. Advancements in engineering, aeronautics are shared. Einstein certainly shared his mathematical theories. The concept of open source is to at least prevent closed source from monopolizing a particular industry and to advance the general good. Closed source still has purpose, but to give it exclusivity is to anoint false gods to rule over you.

  17. interglacialman says:

    From the comments in the report it sounds like the php software is working as designed but not as you expect.

    The easiest way to deal with these kind of issues is to be flexible and change the initial assumptions of how you planned to do the implementation. Even if the problem you have is a bug, or you are convinced your way is the correct one, you’re usually better off just ‘working around’ any software quirk or unexpected limitation.

    I’d count yourself lucky you didn’t have to spend countless hours on the phone to India to arrive at this position. In my experience this kind of problem is even worse with commercial software.

  18. bac says:

    This issue is in the documentation, at least the online version. Plus, there is feed back about how to deal with the behavior.

    It seems to me the Marc is trying to use a development tool without understanding the behaviors of such tool. If he had read the documentation, he would have known about this quirk and avoided using the tool in the way that brings about this quirk.

    If you know the hammer breaks glass and you don’t want to break glass then don’t use the hammer on glass.

  19. ECA says:

    iM SORRY GUYS..
    If you want stuff to work you will have to go back BEFORE visual basic and Visual C..
    GET OFF the new fangled OS’s and back to basic.

  20. jbellies says:

    #33 #35. Pedro and most of those commenting here know that Opera is closed source. I rank his remark as sardonic. Here’s another one: “Perkel isn’t using the right tool for the job. For fancy footwork string output, use Icon rather than PHP.”

    Incidentally, I use Opera 10 (which I call OperaX) and it “works fine for me”.



Bad Behavior has blocked 25398 access attempts in the last 7 days.