SitePoint Sponsor

User Tag List

Page 3 of 3 FirstFirst 123
Results 51 to 73 of 73
  1. #51
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    This whole discussion makes me wonder how hard it would be to back-port object handles to php4. My c is incredibly rusty, and I have no clue how the internals of php are structured so I can't really comment one way or another, but it sure seems like we could kill a lot of the reference incompatability with php5 by performaing that backport (+ clone for when you really need a copy).
    I think the real way for php to survive is to split codebases and create a new (incompatible) language from scratch. Yes, it will be a lot of work to port all those extensions and applications, but improving current codebase seems to be even harder. I am by no means a zend engine expert, but this 1,5 Mb bunch of spaghetti code looks just scary (and detestable). However, the new language with a php4-compatible syntax, with its simplicity and flexibility and without all that legacy rubbish could become successful very quickly (especially if bundled with "normal" php).

  2. #52
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog
    I think the real way for php to survive is to split codebases and create a new (incompatible) language from scratch. Yes, it will be a lot of work to port all those extensions and applications, but improving current codebase seems to be even harder. I am by no means a zend engine expert, but this 1,5 Mb bunch of spaghetti code looks just scary (and detestable). However, the new language with a php4-compatible syntax, with its simplicity and flexibility and without all that legacy rubbish could become successful very quickly (especially if bundled with "normal" php).
    How about Phalanger?

  3. #53
    SitePoint Guru dagfinn's Avatar
    Join Date
    Jan 2004
    Location
    Oslo, Norway
    Posts
    894
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    Neither is passed by reference automatically in php5. Variables now store object handles (kind of like a file handle) so you no longer have to worry about passing them by reference the way you did in php4.
    Sorry to be nitpicking, but I believe reference is the correct term. The PHP manual refers to the PHP 4 references as symbol table aliases.

    On the other hand, you're right that they're not passed by reference. Instead the reference is being passed by value.

    Perl has both mechanisms and they're called reference and alias.
    Dagfinn Reiersøl
    PHP in Action / Blog / Twitter
    "Making the impossible possible, the possible easy,
    and the easy elegant"
    -- Moshe Feldenkrais

  4. #54
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pachanga
    How about Phalanger?
    No, I didn't mean "yet another php port". I meant "yet another php-alike language".

  5. #55
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by stereofrog
    I think the real way for php to survive is to split codebases and create a new (incompatible) language from scratch. Yes, it will be a lot of work to port all those extensions and applications, but improving current codebase seems to be even harder. I am by no means a zend engine expert, but this 1,5 Mb bunch of spaghetti code looks just scary (and detestable). However, the new language with a php4-compatible syntax, with its simplicity and flexibility and without all that legacy rubbish could become successful very quickly (especially if bundled with "normal" php).
    yes well, the thing is that a lot of people won't find that pleasant!! from what I've seen, majority of PHP runs on shared hosting and hosts are one of the slowest when it comes to upgrading software especially if its not a security fix. PHP5 has been out for quite a while but still not a lot of hosts offer it, though it has picked up momentum lately. then there's problem of re-writing the code of current applications. that's gonna be quite a lot expensive, both in terms of money and time!!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  6. #56
    SitePoint Enthusiast dgx's Avatar
    Join Date
    Aug 2005
    Location
    The Czech Republic
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by asp_funda
    PHP5 has been out for quite a while but still not a lot of hosts offer it, though it has picked up momentum lately. then there's problem of re-writing the code of current applications.
    So... write OOP without references in PHP4, there is the solution

    Or write PHP5 code and convert it to PHP4 with PHP 5 -> 4 converter

  7. #57
    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 jayboots
    Wouldn't that still "break" a lot of existing PHP4 code? It occurs to me that the only compatability this would gain is for "new" PHP4 code -- and why not just target PHP5 when writing new code? Especially since the "new" code wouldn't be compatible with previous versions of PHP4 that did not have those semantics. Probably moot anyhow as you already know that the 4.x branch is supposedly closed to new features being accepted
    You are right here. My muddled thinking idea would produce three "branches" to maintain instead of two: php4 with refs, php4 without refs and php5. Better just to bite the bullet and just maintain two versions for php4 and php5 I think.

    Regards,
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  8. #58
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by dgx
    So... write OOP without references in PHP4, there is the solution

    Or write PHP5 code and convert it to PHP4 with PHP 5 -> 4 converter
    no, you took it in wrong instance!! that PHP5 statement & the code re-writing problem aren't related. what I was saying was that PHP5 is still not available with a lot of hosts despite the fact that its been around for quite sometime!! and that code rewrite statement was aimed at stereofrog's propsal of a neater PHP which doesn't have backward compatibility but has neat code & better programming structures. I meant to say that with that being done, the existing code would have to be re-written which won't be economical, neither from financial point of view nor from time consumption!!

    hope you get what I was saying now!!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  9. #59
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by asp_funda
    then there's problem of re-writing the code of current applications. that's gonna be quite a lot expensive, both in terms of money and time!!
    My point is that migrating of legacy apps to php5 (and then to php6) and supporting them across different (possibly BC-breaking) releases could be (and sometimes actually is) more expensive than rewriting from scratch.

    Now, with a big legacy app, you have two choices: port it to php5 (and come back with the same problem six months later) or rewrite it in .net or ruby (which would be nice, but you have to fire all your php programmers first).

    I think the new, neat and clean php-alike language (lets call it "PHPi") may be a real alternative.

  10. #60
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog
    No, I didn't mean "yet another php port". I meant "yet another php-alike language".
    Phuby?

  11. #61
    Web developer Carl's Avatar
    Join Date
    Sep 2003
    Location
    sweden
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pachanga
    I think you're missing the whole point of the discussion.... It's about references usage issues not about proper array usage.
    I guess not because the only thing I could see that was iffy was the use of the construct. The reference call was correct.

    I think the problem with referencing is that developers are creatures of habit and tend to use something until it stops working. Even it is uses a bug in the language or is a terrible coding style.

    I for one am happy to see less of this:

    Code:
    function myfunc(function myfunc1(function myfunc3('dontstink',function myfunc())),function myfunc2());
    .net 2.0 is not backwards-compatible and ruby 2.0 will not be for many parts.

  12. #62
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by stereofrog
    My point is that migrating of legacy apps to php5 (and then to php6) and supporting them across different (possibly BC-breaking) releases could be (and sometimes actually is) more expensive than rewriting from scratch.

    Now, with a big legacy app, you have two choices: port it to php5 (and come back with the same problem six months later) or rewrite it in .net or ruby (which would be nice, but you have to fire all your php programmers first).

    I think the new, neat and clean php-alike language (lets call it "PHPi") may be a real alternative.
    well, I did get your point when you first mentioned. but what I see as a disadvantage is that there is quite a lot of code that isn't dependent solely on PHP4 & breaks in PHP5. so that means that that code can be expanded using PHP5 only paradigm if the PHP install is upgraded, no rewrite or port of the application since its not bound to PHP4(meaning it doesn't use anything/or little something in PHP4 that essentially breaks in PHP5).

    but if there's a new codebase, then those guys would be literally forced to re-write their stuff if they want to use the new features of later PHP versions, which wouldn't be the case if PHP development continues as it is. there's a lot more at stake than just codebase, when you have a software that's used by millions, you simply can't go and release a new version leaving the current users out in cold. that would convey a message to the users that you are not dependable and they'd switch faster than you can say 'stop', which certainly won't be in your benefits. that's why keeping backwards compatibility(as much as possible) is so important!!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  13. #63
    SitePoint Guru
    Join Date
    Nov 2002
    Posts
    841
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are two audiences for PHP.
    1. PHP as a deployment platform for standard web applications.
      This is the world of cheap hosting, phpBB, WordPress, and vBulletin. These guys want bugs fixed and absolute compatibility. These guys are still running PHP 4.
    2. PHP as a deployment platform for custom web applications.
      This is the world of in house development. These guys want new features. Hello PHP 5.


    PHP faces a balancing act trying to satisfy both camps. The farther apart the two camps get, the worse off PHP will be. Stray too far and you will see a project fork.

    References are a unique kind of problem. They are a complete dead end. They are the biggest divider between the two camps. The second biggest divider is exceptions. There is simply no solution that is compatible between PHP 4 and PHP 5.

    Together these form a significant upgrade barrier. Once this barrier is crossed, future upgrades will be less painful. The types of BC breaks that they are talking about for PHP 6 are minor compared to references and exceptions. Afternoon with grep versus application re-write.

  14. #64
    SitePoint Member
    Join Date
    Dec 2004
    Location
    Netherlands
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    I have used Eclipse (from Voostind) in some projects. In these projects I get notices since I have upgraded to PHP 4.4.1. This is caused by the issue discussed in this thread.

    I am trying to solve the issue, by using the proposed adjustments. The notice-messages will indeed disappear, however, now I get a fatal error:
    Code:
    Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 123 bytes) in /usr/local/plesk/apache/.....php on line ...
    It looks like something goes wrong with the Loop-class in combination with the QueryIterator. Right now I am desperatily trying to solve this problem.
    I know there are many persons on these forums who have used Voostind's Eclipse library. Is there anyone with the same problem who has solved it? Any suggestions maybe?

    Thank you in advance!

    EDIT
    My problem about the memory size is caused by an other bug I think:
    http://bugs.php.net/bug.php?id=35444
    http://bugs.php.net/bug.php?id=35070
    Last edited by raps; Dec 1, 2005 at 15:25.

  15. #65
    SitePoint Addict
    Join Date
    May 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog
    My point is that migrating of legacy apps to php5 (and then to php6) and supporting them across different (possibly BC-breaking) releases could be (and sometimes actually is) more expensive than rewriting from scratch.
    Re-writing doesn't solve the "support over different releases" problem at all.

    Now, with a big legacy app, you have two choices: port it to php5 (and come back with the same problem six months later) or rewrite it in .net or ruby (which would be nice, but you have to fire all your php programmers first).
    You could re-write in another language, but you gain very little from that. The only languages that are future-proof are the ones that never add any really great features (i.e. they stick with the same broken, hard-to-use mistakes for years and years). Also, if you have hired programmers who can't use more than one language, you're a horrible judge of talent.

    I think the new, neat and clean php-alike language (lets call it "PHPi") may be a real alternative.
    Except for the fact that nobody would use it, hosts would never install it, and it would just be a fork that nobody of note was contributing to. In other words -- useless.

    The main reason that PHP5 hasn't been adopted by many hosts (it's outright ignorance to say "most", because pretty much all of the top hosts [both by quality and number of sites hosted] do offer PHP5 -- they just usually don't offer the option of running both 4 and 5 side by side).

    The reference fix has definitely been the biggest PITA that I've encountered in PHP, but the truth of the matter is that very few applications that see widespread release are seriously impacted. Here's a list of apps that work just fine on both:

    - MediaWiki
    - vBulletin
    - PHPBB
    - x-cart
    - osCommerce
    - SugarCRM (technically there's one big bug with this one, but it's an easy find-and-replace)
    - WordPress
    - SquirrelMail
    - phpAdsNew
    - phpMyAdmin
    - Mantis
    - PHP-Nuke
    - PostNuke
    - Mambo / Jumla (or however they spell it)
    - TYPO3

    And those are just the ones that I've worked with personally over the last few months.

  16. #66
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by Etnu
    Except for the fact that nobody would use it, hosts would never install it, and it would just be a fork that nobody of note was contributing to. In other words -- useless.
    quite right!! like I previously said, majority of sites running PHP are on shared hosting and hosts wouldn't install the fork or upgrade if it breaks the existing applications, no matter how improved the codebase & performance is. server resources are cheap these days, be it RAM or Processors, so hosts care more about loosing out customers rather than upgrading a software just because it runs well & has better-cleaner-tighter code. they want backward compatibility first & then anything else.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  17. #67
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Etnu
    The only languages that are future-proof are the ones that never add any really great features (i.e. they stick with the same broken, hard-to-use mistakes for years and years).
    There are many examples of languages which have evolved over years, acquired "really great feauters", even splitted into many incompatible branches and nevertheless remain successful and "future-proof". Lisp is a classic example, pascal and smalltalk are also good ones to remember.

    The secret is simple: those languages were designed by the people who have a clue on what to do.

    The evolution of php went so far by "negotiation" principle: lets add new feaure A -- yeah, cool! -- feature A causes bug X -- fix bug X - fix of X causes bug Y - okay, lets deprecate A -- lets throw core warning about A -- yeah, cool!..

    Unfortunately, php6 project notes can only confirm this impression.

  18. #68
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good point, frog. PHP is one of the few widely-used languages that have one and only one implementation (Java and Ruby being others I can think of; C# is too new, and even Python has Boo).

    Perhaps we really could use an OOPS -- Object Oriented PHP Something -- which would be rewritten from scratch with an object model as it should have been from day one. On the other hand, we might be better off creating a new language -- just like Ruby is "Perl OOP done right".

  19. #69
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    Good point, frog. PHP is one of the few widely-used languages that have one and only one implementation (Java and Ruby being others I can think of; C# is too new, and even Python has Boo).
    I'm not entirely sure of the point of multiple implementations. Never-the-less, C# (Mono for one), Python (IronPython for one), PHP (Roadsend, Phalanger), Java (IBM, gcj and others) have more than one implementation and I understand that an alternate implementation for Ruby is in the works.

    Okay, PHP grew organically -- so? It may not be nearly as elegant as Lisp but despite that, it is still a useful environment. Maybe just because it grew on an as-needed-basis. Consider the analogy of equating Lisp to Sanskrit as "perfect languages" (ie: well defined and entirely systematic); by extension, PHP would probably then be equated to english -- another example of a successful language that continues to grow in multiple unorganized directions and has many dodgy rules.

  20. #70
    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 jayboots
    I'm not entirely sure of the point of multiple implementations. Never-the-less, C# (Mono for one), Python (IronPython for one), PHP (Roadsend, Phalanger), Java (IBM, gcj and others) have more than one implementation and I understand that an alternate implementation for Ruby is in the works.
    OK, implementation was not the right term -- various "editions", with different syntax etc, would be more correct.

  21. #71
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo
    No, that's the odd thing here: foo($a=1) works even if the function is defined like this:
    PHP Code:
    function foo(&$param
    This is now throwing an E_STRICT in 5.1.2-dev. Further, the reference is lost. Apparently, this is the correct behaviour.

    http://bugs.php.net/bug.php?id=35715

  22. #72
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jayboots - just seems to me like syntax consistency. No major ojections.

    function myfunc(function myfunc1(function myfunc3('dontstink',function myfunc())),function myfunc2());
    Not to be anal, but that isn't syntactical. And, few experienced coders would code like that.

  23. #73
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Super Phil: Hi. It was just an update -- I pointed to that change because earlier in the thread that same example was used to show that the previous behaviour was actually unexpected.

    Best


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
  •