PHP5 - *ANY advantage??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Hassall

    #16
    Re: PHP5 - *ANY advantage??

    On Tue, 2 Dec 2003 17:37:25 +0100, "Daniel Andislic" <srebrenik@gmx. net> wrote:
    [color=blue]
    >as far as I know, PHP5 currently works with SQLite for licence reasons
    >(MySQL AG)[/color]

    Where did this myth start up in the first place? Was it just because they
    happened to announce SQLite support at the same time as removing the bundled
    MySQL client library? (client library != the PHP MySQL extension).

    MySQL support is not being removed; in fact it's being improved (see the
    mysqli functions).

    --
    Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
    Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

    Comment

    • Nikolai Chuvakhin

      #17
      Re: PHP5 - *ANY advantage??

      mike.m@komatia. com (mikel) wrote in message
      news:<e93060dc. 0312020504.69df 1626@posting.go ogle.com>...[color=blue]
      >
      > php5 is in everybodies mouth - but what are the *real* advantages
      > and plus' compared to php4?[/color]

      If you like OOP, you'll probably get a kick out of the new object
      model. If you understand OOP, you will still be wondering how
      much sense OOP makes without strong typing. If you don't like OOP,
      it'll be a huge disappointment: slightly larger system footprint,
      but no additional functionalilty; just another step along the way
      of turning PHP into a Java clone.

      For more information, see



      Cheers,
      NC

      Comment

      • Ian.H

        #18
        Re: PHP5 - *ANY advantage??

        On Tue, 02 Dec 2003 16:43:53 -0800, Nikolai Chuvakhin wrote:


        [ snip ]

        [color=blue]
        > but no additional
        > functionalilty; just another step along the way of turning PHP into a Java
        > clone.[/color]


        Nik,

        I heard there was quite a performance increase over the 4.x branch too. I
        can't say I've had the pleasure of trying PHP5 as yet, been too busy.. I
        may be wrong, but I thought I read somewhere that performance and a few
        other "efficienci es" had been incorporated. Feel free to correct me if I'm
        wrong.. I'm interested to hear PoV from people that have tried it too =)



        Regards,

        Ian

        --
        Ian.H [Design & Development]
        digiServ Network - Web solutions
        www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
        Programming, Web design, development & hosting.

        Comment

        • Rahul Anand

          #19
          Re: PHP5 - *ANY advantage??

          "Useko Netsumi" <usenets@yahoo. com> wrote in message news:<bqi9pm$22 usjo$1@ID-205437.news.uni-berlin.de>...[color=blue]
          > I'd love to see some tutorial and examples using this new version of PHP,
          > especially with the latest MySQL4 and Apache2. Thanks
          >
          >
          > "mikel" <mike.m@komatia .com> wrote in message
          > news:e93060dc.0 312020504.69df1 626@posting.goo gle.com...[color=green]
          > > Hello,
          > >
          > > php5 is in everybodies mouth - but what are the *real* advantages and
          > > plus' compared to php4?
          > >
          > > mikel[/color][/color]

          Hi,

          I found this link, which shows the OOP Concepts implemented under PHP5



          rahul

          Comment

          • rush

            #20
            Re: PHP5 - *ANY advantage??

            "Nikolai Chuvakhin" <nc@iname.com > wrote in message
            news:32d7a63c.0 312021643.1df15 db6@posting.goo gle.com...[color=blue]
            > If you like OOP, you'll probably get a kick out of the new object
            > model. If you understand OOP, you will still be wondering how
            > much sense OOP makes without strong typing. If you don't like OOP,[/color]

            Well, there are quite a few people who make this queston other way around,
            how mocu sense does OOP make with strong typing? Especially inventors of OOP
            like Alan Kay.

            rush
            --
            Get your very own domain easily. Fast and professional customer service.



            Comment

            • Phil Roberts

              #21
              Re: PHP5 - *ANY advantage??

              With total disregard for any kind of safety measures nc@iname.com
              (Nikolai Chuvakhin) leapt forth and uttered:
              [color=blue]
              > If you understand OOP, you will still be
              > wondering how much sense OOP makes without strong typing.[/color]

              SmallTalk is regarded as one of the most Object Oriented languages
              available. It does not use strong typing, but dynamic types. Just
              like PHP.
              [color=blue]
              > you don't like OOP, it'll be a huge disappointment: slightly
              > larger system footprint, but no additional functionalilty; just
              > another step along the way of turning PHP into a Java clone.[/color]

              You sound rather bitter, did Java steal your girlfriend or
              something?

              --
              There is no signature.....

              Comment

              • Tim Tyler

                #22
                Re: PHP5 - *ANY advantage??

                Nikolai Chuvakhin <nc@iname.com > wrote or quoted:[color=blue]
                > mike.m@komatia. com (mikel) wrote:[/color]
                [color=blue][color=green]
                >> php5 is in everybodies mouth - but what are the *real* advantages
                >> and plus' compared to php4?[/color]
                >
                > If you like OOP, you'll probably get a kick out of the new object
                > model. If you understand OOP, you will still be wondering how
                > much sense OOP makes without strong typing. If you don't like OOP,
                > it'll be a huge disappointment: slightly larger system footprint,
                > but no additional functionalilty; just another step along the way
                > of turning PHP into a Java clone.[/color]

                Better an unencumbered Java clone than a hastily-hacked-together
                scripting language, hey?
                --
                __________
                |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

                Comment

                • Keith Bowes

                  #23
                  Re: PHP5 - *ANY advantage??

                  Nikolai Chuvakhin wrote:[color=blue]
                  > just another step along the way
                  > of turning PHP into a Java clone.
                  >[/color]

                  We have to learn Java somehow, and we sure can't via Sun's tutorial. :)

                  Comment

                  • Tim Tyler

                    #24
                    Re: PHP5 - *ANY advantage??

                    Keith Bowes <do.not@spam.me > wrote or quoted:
                    [color=blue]
                    > We have to learn Java somehow, and we sure can't via Sun's tutorial. :)[/color]

                    http://www.mindprod.com/jgloss/jgloss.html can be useful.

                    It's curious how Apache are supporting both Java and PHP.

                    It must produce some level of schizophrenia internally.
                    --
                    __________
                    |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

                    Comment

                    • Chung Leong

                      #25
                      Re: PHP5 - *ANY advantage??

                      The features I'm looking forward to using are destructor and property. They
                      allow you to very neatly encapsulate your database access code. Say you're
                      writing a message forum webapp. You would have a Message class that looks
                      something like this:

                      class Message {
                      private $values;
                      private $columns_change d;
                      private $primary_key;

                      function __destruct() {
                      if($this->primary_key) {
                      $this->DoDBUpdate() ;
                      }
                      else {
                      $this->DoDBInsert() ;
                      }
                      }

                      function DoDBUpdate() {
                      foreach($this->columns_change d as $column) {
                      ...
                      }
                      }

                      function __set($name, $value) {
                      if($this->values[$name] != $value) {
                      $this->values[$name] = $value;
                      $this->columns_change d[] = $name;
                      }
                      }

                      function __get($name) {
                      return $this->values[$name];
                      }
                      }

                      To insert a message, you'll would do something like:

                      $msg = new Message();
                      $msg->title = $_POST['title'];
                      $msg->text = $_POST['text'];

                      Assignments to the undeclared variables title and text triggers the objects
                      __set() function, which records the names of these properties so that it
                      knows which table columns to update. When the object is destroyed, the
                      destructor is triggered, which save the changes to the database.

                      Property access is great in that it fits in perfectly with one of PHP's
                      great strength: variable interpolation (i.e. sticking variables into
                      double-quoted strings). You can now, in essence, call a function from within
                      a string. Using the message forum example again: When you out put a message,
                      you'll find inevitably that you need to do a htmlspecialchar s() on most
                      properties of Message. In PHP4, you would have to either use a lot of
                      temporary variables or break up your strings into ugly fragments ( "<h1>" .
                      htmlspecialchar s($msg->title) . "</h1>" ). In PHP5, you can modify __get()
                      like this:

                      function __get($name) {
                      if(substr($name , -5) == '_html')) {
                      $need_htmlspeci alchars = true;
                      $name = substr($name, 0, -5);
                      }
                      $value = $this->values[$name];
                      if($need_htmlsp ecialchars) {
                      $value = htmlspecialchar s($value);
                      }
                      return $value;
                      }

                      so that all you have to do is to append the suffix '_html' to a property
                      name to get it properly escaped ( echo "<h1>$msg->title_html</h1>" ).

                      Uzytkownik "mikel" <mike.m@komatia .com> napisal w wiadomosci
                      news:e93060dc.0 312020504.69df1 626@posting.goo gle.com...[color=blue]
                      > Hello,
                      >
                      > php5 is in everybodies mouth - but what are the *real* advantages and
                      > plus' compared to php4?
                      >
                      > mikel[/color]


                      Comment

                      • Nikolai Chuvakhin

                        #26
                        Re: PHP5 - *ANY advantage??

                        "rush" <pipa@rush.aval on.hr> wrote in message
                        news:<bqk5r7$jt $1@ls219.htnet. hr>...[color=blue]
                        > "Nikolai Chuvakhin" <nc@iname.com > wrote in message
                        > news:32d7a63c.0 312021643.1df15 db6@posting.goo gle.com...[color=green]
                        > > If you like OOP, you'll probably get a kick out of the new object
                        > > model. If you understand OOP, you will still be wondering how
                        > > much sense OOP makes without strong typing. If you don't like OOP,[/color]
                        >
                        > Well, there are quite a few people who make this queston other way
                        > around, how mocu sense does OOP make with strong typing? Especially
                        > inventors of OOP like Alan Kay.[/color]

                        Last time I heard, invention of OOP was attributed to Niklaus Wirth...
                        But, then, I may be listening to wrong people... :)

                        Cheers,
                        NC

                        Comment

                        • Nikolai Chuvakhin

                          #27
                          Re: PHP5 - *ANY advantage??

                          Phil Roberts <philrob@HOLYfl atnetSHIT.net> wrote in message
                          news:<Xns944671 E30AA8Cphilrobe rts@206.127.4.2 2>...[color=blue]
                          > With total disregard for any kind of safety measures nc@iname.com
                          > (Nikolai Chuvakhin) leapt forth and uttered:
                          >[color=green]
                          > > another step along the way of turning PHP into a Java clone.[/color]
                          >
                          > You sound rather bitter, did Java steal your girlfriend or
                          > something?[/color]

                          Honestly, I could not care less about Java; it exists in a universe
                          totally separate from mine. The reason I am bitter is because the
                          current PHP team seems to develop PHP in ways that are totally
                          irrelevant to me and my needs. For example, I would rather have
                          PHP totally void of OOP, but with a good statistical library
                          included in the standard distribution (good statistical libraries
                          are not object-oriented anyway).

                          Cheers,
                          NC

                          Comment

                          • Nikolai Chuvakhin

                            #28
                            Re: PHP5 - *ANY advantage??

                            Tim Tyler <tim@tt1lock.or g> wrote in message
                            news:<HpC749.A7 7@bath.ac.uk>.. .[color=blue]
                            >
                            > It's curious how Apache are supporting both Java and PHP.
                            > It must produce some level of schizophrenia internally.[/color]

                            No it shouldn't. Apache simply decides which module to call
                            to parse a file with a particular extension. And options
                            may, in additions to Java and PHP, include SSI, Perl, Python,
                            etc...

                            Cheers,
                            NC

                            Comment

                            • Tim Tyler

                              #29
                              Re: PHP5 - *ANY advantage??

                              Nikolai Chuvakhin <nc@iname.com > wrote or quoted:[color=blue]
                              > Tim Tyler <tim@tt1lock.or g> wrote in message[/color]
                              [color=blue][color=green]
                              >> It's curious how Apache are supporting both Java and PHP.
                              >> It must produce some level of schizophrenia internally.[/color]
                              >
                              > No it shouldn't. Apache simply decides which module to call
                              > to parse a file with a particular extension. [...][/color]

                              I mean within the Apache Software Foundation - e.g. when it comes
                              to allocating funds.
                              --
                              __________
                              |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

                              Comment

                              Working...