SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 54
  1. #26
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    I'll stick my neck out here and give my definition of what I think is a bug: "Fundamental language constructs should not throw fatals". Hardly radical, is it?

    yours, Marcus
    Sort of reminds me of another indiviual who stuck his neck out and stated "The laws of physics should be the same in all frames of reference."

    That one lead to a lot of work and restructuring of thought processes too

  2. #27
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Markus,

    the "bug" you described is a common zend engine problem, and has generally nothing to do with php5 and oop. Consider the following:

    PHP Code:
    $a = array(123);
    $a[0] = &$a;
    var_dump($a[0] == $a); 
    Both php4 and php5 die gaily, informing you that "nesting level is too deep". The reason is that they (I repeat myself) implemented deep (or "content") comparison for compound objects. This solution definitely was a design mistake, but I don't believe they can change it without breaking legacy code. A realizable way to fix this would be to introduce __equals and have "object == object" to call __equals if it's defined. Unfortunately, zend doesn't seem to want this (http://bugs.php.net/bug.php?id=25772).

    Obviously, ZE lacks shallow comparator, but ZE internal walkers like var_dump or serialize are luckily recursion-aware, so one can use them to emulate shallow comparison. That would be an ugly hack of course, but it's still better than fatal error.

    As to fatal errors in general I agree. For me, fatal errors in php just mean "we have no clue how to handle this"... I'd even strengthen your point by saying "runtime code should not throw any errors it cannot handle". That's nice, but unfortunately has nothing to do with this issue. The code you posted works (or doesn't work) exactly how specifications predicts, so no bug

  3. #28
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    technically, anyone that has the php source and can write in c, could possibly implement a fix and then create a build and then send it to send or even help with development on 5.1 which is in beta now.

  4. #29
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by stereofrog
    Markus,
    No, the other Marcus...

    Quote Originally Posted by stereofrog
    This solution definitely was a design mistake, but I don't believe they can change it without breaking legacy code.
    This isn't actaully true. The problem arose because of a difference between PHP4 (which worked at the time) and PHP5 (which fatals). The problem (I say again) is not the the legal small print of what Zend promises their langauge does or otherwise. the problem is the implications...

    1) That every equals oparison is a time bomb waiting to go off even though the code looks natural.
    2) That they cannot be bothered to fix serious langauge issues.

    It's actually number 2 that is the more worrying.

    Quote Originally Posted by stereofrog
    A realizable way to fix this would be...
    There are lot's of ways to fix this of course.

    Quote Originally Posted by stereofrog
    but ZE internal walkers like var_dump or serialize are luckily recursion-aware,
    The problem is that you can serialise the same objects and get different results each time. If you have two refernces pointing to the same object in another object, it is pot luck as to which will be labelled as recursive. Even the possible workarounds don't work.

    Quote Originally Posted by stereofrog
    so one can use them to emulate shallow comparison. That would be an ugly hack of course, but it's still better than fatal error.
    Quite, and I tried that. So PHP is the ugly hack language then?

    Quote Originally Posted by stereofrog
    That's nice, but unfortunately has nothing to do with this issue. The code you posted works (or doesn't work) exactly how specifications predicts, so no bug
    Having published an equality operator and then rendered it almost unusable is a bug. That's the point of why I am raising this issue. It doesn't matter whether it is a specification bug or an implementation bug, it's still a bug. It's still deeply wrong at the level of having pride in one's work. I see no pride here, either in the code or the bug management, just a fob off.

    That's disturbing and so far removed from an enterprise culture, let alone an engineering culture, as to render PHP a joke in these fields. Can you honestly imagine walking up to a Java or C++ developer (it works in C++ btw) and not have them burst into fits of hysterics at this.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  5. #30
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree almost completely (except technical part). These are exactly the reasons why I don't use php anymore.

  6. #31
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    So PHP is the ugly hack language then?
    Unfortunately so.

  7. #32
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    Having published an equality operator and then rendered it almost unusable is a bug.
    The identity of an object is such a fundamental principle of object orientation that asserting the equality or difference, either physical or logical, of any 2 given objects should be safe and simple in any programming language that supports object orientation. Period.

    You have rightfully so addressed this issue as a bug and it's rather shocking it's been declared 'bogus". Rep given (well mentally anyway )
    Per
    Everything
    works on a PowerPoint slide

  8. #33
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The whole difference between equal and identical is a "don't" if you ask me. It originates from the dynamic typing in PHP.

  9. #34
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So PHP is the ugly hack language then?
    I don't actually think so, but no one is forcing PHP on you, are they?

  10. #35
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't actually think so, but no one is forcing PHP on you, are they?
    No, but that attitude won't lead to any improvement of existing products either.

  11. #36
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May I ask, what the hell is "Bogus". The Zend team have fetish for marking bug reports as "Bogus". Surely, they would either fix the bug and close it, or mark it as won't fix.

    I do agree that because PHP has no set design specs, it has got riddled with "gottchas" over the years. In fact I would say that these gottchas are more common and more annoying sometimes than the ones you expect to see in C++ (which is known for it's querkiness).

    The fact that the Zend people have taken about 4 months to reply is not really very good, when you consider customer support as part of the criteria for entperise development

  12. #37
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, but that attitude won't lead to any improvement of existing products either.
    Your right, I'm sorry, but it's just been one of those days... The weekend will make up for it, for me I hope

  13. #38
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Useful link

  14. #39
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Captain Proton
    The whole difference between equal and identical is a "don't" if you ask me.
    Captain, would you mind explaining that part a bit further, I'm afraid I do not understand what you mean by this. (could be the language barrier as english is not my native tongue). I suppose you're talking about the == operator (equality) and the === operator (identical)? But what do you mean when you say that "the difference between them is a don't"? TIA.
    Per
    Everything
    works on a PowerPoint slide

  15. #40
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Useful link
    Why does it seem that in the 10th link on that page ("Nesting level too deep - recursive dependency?") they seem to have implemented doing a === check before an ==? Shouldn't that have resolved this problem?
    Christopher

  16. #41
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I've seen this too, but unfortunately this doesn't solve the problem. The point is that '===' (identity) implies '==' (equality) and the engine can stop deep comparison if it detects that two objects are identical. Apparently, the reverse is untrue and when engine encounters two non-identical objects it performs deep comparison of them. Two "me" members in Marcus's snippet are not identical, hence the error.

    For C programmers among us here's the patch in question

    http://cvs.php.net/diff.php/ZendEngi...&r2=1.198&ty=h

  17. #42
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I totally agree with Marcus, having that sort of bugs in the PHP core is like living on a volcano!

    I already posted about this bug a very long time somewhere at SitePoint, it pops up pretty often during unit testing(one of the possible workarounds in some cases is to use IsAExpectation instead of EqualExpectation, that's ugly but at least it works somehow )

    And of course even the bigger problem is the core developers attitude... I heard a pretty scaring rumor somewhere that core PHP devs don't use OOP for their everyday work and that it's actually the root of all OO problems in PHP(the one Marcus mentioned here, namespace support, etc)

    Are there any ways we can affect PHP devs to have a closer look at this and some other critical PHP issues? Maybe some sort of a very polite petition could help us draw their attention? Well some might say "send a patch or shut up", i'd love to help...but i'm not a C guru and it may take ages before i actually pinpoint the source of this and other bugs...
    Last edited by pachanga; May 20, 2005 at 12:34.

  18. #43
    SitePoint Evangelist ghurtado's Avatar
    Join Date
    Sep 2003
    Location
    Wixom, Michigan
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pachanga
    Are there any ways we can affect PHP devs to have a closer look at this and some other critical PHP issues?
    Sure, participate in the development of PHP and I am sure that you will be able to influence it more directly.
    Garcia

  19. #44
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Has anyone replied to Andi's last post? Seems to me he's pretty reasonable -- Marcus, why don't you send an email directly to the horse's mouth?

  20. #45
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    I'll have to sign up to the dev list. It looks like it's a far better way of getting one's voice heard than the bug system for sure. I am also from a C background, which helps. The problem for me is that PHP is now only a part of the work that I do. Learning the source of the language engine was not on my TODO list.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  21. #46
    SitePoint Guru 33degrees's Avatar
    Join Date
    May 2005
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    So PHP is the ugly hack language then?
    Well I wouldn't go that far, but it definitely feels like it has evolved rather than having been designed, which has its good points and its bad points. There a definitely more elegant languages out there (Ruby for one), but none of them are as cheap and prevalent as PHP (with the possible exception of perl, but that's an ugly hack language as well)

  22. #47
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Slightly off-topic, but the PHP Developers are the same when it comes to feature suggestions. A couple of times I've suggested small changes, such as making highlight_string() and highlight_file() output XHTML compliant code and linking the information from phpinfo() to the relevant pages in the manual. In both cases I supplied the code to do what I suggested and even the files and line numbers that would need editing. For my first example, I got the response "We'll do so when standard compliance really matters" and this was later marked as "Won't fix" even though this has now been changed in PHP5. The second example was completely ignored. I don't bother making suggestions any more and from the experience Marcus has outlined here reporting bugs seems just as futile

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  23. #48
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "We'll do so when standard compliance really matters"
    If that is literally the response you got, that is terrible. An attitude like that results in everybody waiting for everybody else to comply to standards, so the standard never gets implemented..

  24. #49
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Captain Proton
    If that is literally the response you got, that is terrible
    Yep, that was the first response I got. I was then told that it is better to leave the functions as they were to cater for text browsers

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  25. #50
    SitePoint Evangelist DMacedo's Avatar
    Join Date
    May 2004
    Location
    Braga, Portugal
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking (Sorry for going a bit offtopic here ...)

    I hate seeing this type of attitude in developers.

    You can't change PHP, you can't find the time in your day to do that, and I am no C expert, so it would take me even longer. Same with whatever OS we use or hardware we buy.

    I would like to have the time, experts and funds to create hardware and software from scratch, things would work a lot different from what we see today.

    I want to leave all current hardware and software behind. Start new standards and make "old" standards in hardware and software seem like wood opposed to concrete and steel bars! Solid, efficient, shape able and combustion safer!

    And I also want peace to prevail and hunger to end.

    Thank you
    ~ Daniel Macedo


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
  •