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.
How is that not a bug? totally ridiculous. I guess it’s “a feature” now they’ve documented it, oldest one in the book.
This is not an example of an open source project’s failure to take responsibility for its bugs; this is an example of the post’s author failing to realize that civilized adults can disagree about what is the “right thing” to do without whining to a random blog that the other guy is an idiot.
The programmers of PHP are not responsible to make it behave the way Mr. Perkel thinks it should, nor are they even responsible to explain to him why they choose to document and leave the present behavior.
Here’s the difference between open source and proprietary software: if Mr. Perkel is so annoyed by this behavior so much, he’s perfectly free to fix it himself, and even to promote his forked version to others who might agree with him. Try that with a Microsoft or Apple product.
It’s not just that it’s a bug – but I told them specifically how to fix it and they still won’t do it.
Marc,
If you persist in ruining the “illusion” we live in, you will soon find the men in black at your door.
Now, Repeat after me, “a bug is a feature that has not been marketed yet.. a bug is a…”
-s
Easy solution — use one of your fancy compilers that you wrote. Then you don’t need to deal with any of this.
It makes me laugh that you label this as an example of why OSS is a problem. The list of documented bugs in software that you actually PAY for (like from MS) that they refuse to fix is huge.
This is actually an example of why OSS is superior. You feel it is a problem, you know what the fix is, go ahead and d/l the source for PHP and fix it. Make your own fork. Try doing that when you find a bug in asp.net that microsoft refuses to fix.
1. “PHP example of why open source is a problem”
2. “This is why open source has a bad name because people don’t fix what is obviously a bug.”
What? How does do you get from this to the whole concept of open source? Had this been the case with proprietary software would this reflect on all vendor of proprietary software?
Who is stopping you from getting the code, fixing it and submitting a patch?
#4 yeah – that’s the whinny excuse that open source programmers give for incompetence. 1) Fix it yourself. 2) No one is paying me money. It’s either done right or it isn’t and this isn’t. There’s no excuse for it.
Yeah, good thing there are responsible software companies like Microsoft and Apple that always listen to their users, fix bugs immediately, carefully document everything, make updates available for free to everyone.
I can’t agree with you Jimmy.
I constantly hear that open source is superior due to the fact that developers can quickly move to fix problems exactly like this. ie. “linux is superior because the community quickly moves to fix security flaws” etc.
If PHP is meant to be superior to ASP and other languages as a development tool, then the primary developers should want to move quickly to fix this type of bug..
Regardless of how bad(or good) commercial software developers may be at fixing bugs, comparing the two models isn’t a fair assessment of this incident.
Responsibility equates to accountability.
What’s wrong with hard core OSS supporter like Jimmy who thinks such irresponsible response is acceptable when it comes to OSS? Is he actually arguing that having lazy/irresponsible support is actually a benefit of OSS since if you do not like the code you can fix it yourself?
Sure, it is probably a bit misleading to jump to conclusion that this particular case is caused by OSS developers don’t have the financial incentive to work harder since I do see that commercial supports can sometimes be just as bad. But still, how can you not only defend such practice, but also claiming it to be a “benefit”???
You reported an issue that has been reported many times (apparently you didn’t search for your issue before reporting) and that is not a bug anyway. The discussion has been going on since at least 2004 and there are legitimate reasons not to automatically unset after the foreach… reasonable people disagree.
It is not appropriate to insist that this is a bug when the community has decided it is not. There are many oddities in how MS C# and other commercial software works (MANY!, I bet I could give 50 examples off the top of my head), so I don’t understand the indictment of OSS in general because PHP has an oddity (that is documented, and that has already gone through a community process).
Why not just unset($x) like it says in the manual?
PHP is garbage anyway. Why use it?
It’s difficult, not efficient and leads to massive spaghetti code.
May PHP DIE! Tommorrow!!
Here’s another example that’s still a problem for me.
The Java ODBC connector does not support reading UTF-16 characters from an Access DB. This “bug” has existed since 2005. They plan on fixing it in JDK 7 (1.7) JDK 7 was supposed to be released in 2008, then Jan 2009. Still waiting…
#7, #9
Yeah, this makes OSS superior. If you have an issue with how something works you have the ability to do something about it.
In this case, it seems to be a difference of opinion. Yeah, Marc thinks it’s a “bug”. It is well documented how to get it to work the way he wants.
Now, if that isn’t good enough for him, he can “fix” it to work exactly how he wants.
If I run into a problem (or a difference of opinion) with how asp.net works, what are my options? Getting microsoft to fix it is rarely a solution (even for real bonafide bugs).
So, tell me, which is better? The way where you pay huge amounts of money with no recourse or ability to fix it. Or the one that is free and gives you complete control to make it exactly the way you want it to be?
Over and over and over again you have exposed yourself as the whiny little baby, Marc. Especially when you are having to deal with the open source community. Honestly, no one is forcing you to use all this software. Why do you keep torturing yourself with it? If it is so painful to struggle with, STOP DOING IT. Just leave it alone, and stick with proprietary stuff.
Typical Perkel talking out his arse. As is clearly pointed out in the responses to the bug report, Perkel is thinking of references in another language and not in PHP. A rational person can understand that based on the design and semantics of PHP, this *is* correct behavior. Perkel, however, is too much of a cry baby.
Is it really unexpected and bizarre behavior? Sure.
Can it be easily fixed in Perkel’s own code? Sure.
Is he picking a fight anyway in a futile attempt to have the bigger dick? You betcha!
Documenting a bug doesn’t make it not a bug. It just means that you are too lazy to fix it.
The problem with Open source is consistency.
For me or anyone with real sense to use the software for actual, billable applications I HAVE to KNOW that I can count on the basic software to work properly.
Oddities like this, that are simple to fix are no excuse. You people saying it’s ok — you must be in government or the university system where it’s fine to waste hours on figuring out why something is failing that SHOULD WORK IN AN OBVIOUS, CONSISTENT WAY.
If I had told my customer this was a great language/library set to use and built software that then failed because of a stupid issue like this, guess what, I’d never get more work from them.
OSS will never be on my list of software I suggest for customers, as there is no recourse for bugs other than random groups of software people who may… or may not actually know what they are doing. And, of course, think they know MUCH more than you what is right and wrong.
Simple answer, buddy, is NOT to use that software and to buy a product that works the way you expect it to. You’ll save yourself hours of wasted effort and time, and you can then scream at people who will actually DO something to help you rather than point to bug lists and support groups and tell you to fix it yourself.
I don’t have time to build my own crap, nor do I have billable time to fix other people’s errors. I’m not in some university with nothing else to do all day, which is a large part of the OSS problem.
#12 “there are legitimate reasons not to automatically unset after the foreach…”
His suggestion was to unset the variable at the *start* of a foreach loop not *after*
@Marc Perkel
What you are doing is technically wrong.
Your second loop statement should be:
foreach($myarray as &$x) { }
You already defined $x as a point above and $x isn’t scoped to that foreach() block but for the rest of the script (excluding functions defines).
If you don’t agree with that behavior that is fine. However claiming it is a bug is wrong.
You should use a different variable or unset($x).
I could claim that
$x = 10;
function foo()
{
print $x;
}
not printing “10” is a bug, but the PHP group would throw out it because they don’t agree that global variables should influence functions unless you do a “global $x” within them.
Same type of behavior.
Meh.. missed the “foo();” call after the function call above. =)
It works properly in php.net you skould ditch the crap freetard version and go with msft version and leave mysql behind as well.
You get what you paid for.
And it’s worth twice what I paid for it.
#20 for the win
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.
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.
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?
#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.
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.