By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

PHP5 - *ANY advantage??

P: n/a
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel
Jul 17 '05 #1
Share this Question
Share on Google+
28 Replies


P: n/a
"mikel" <mi****@komatia.com> wrote in message
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel


new object model, exception handling, integration of gnome's xmllib2,
namespaces, interfaces..

really object-oriented..

d
Jul 17 '05 #2

P: n/a
An noise sounding like Daniel Andislic said:
"mikel" <mi****@komatia.com> wrote in message
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel


new object model, exception handling, integration of gnome's xmllib2,
namespaces, interfaces..

really object-oriented..

You can work with XML documents as Objects out of the bag. Whoot! I'm
personally looking really forward to ease of implementation in that regard.

db
--

I'm a dead man, and buggered to boot!

Jul 17 '05 #3

P: n/a
Daniel Andislic:
new object model, exception handling, integration of gnome's xmllib2,
namespaces, interfaces..


I think they discarded namespaces :/

André Nęss
Jul 17 '05 #4

P: n/a
Daniel Andislic wrote:
"mikel" <mi****@komatia.com> wrote in message
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

new object model, exception handling, integration of gnome's xmllib2,
namespaces, interfaces..

really object-oriented..


By the way - anyone know if any webhosting companies provide "beta"
servers with PHP5 installed for a little price?

(Okay call me lazy - but whatever :D)

Regards,
Johan

Jul 17 '05 #5

P: n/a
"mikel" <mi****@komatia.com> wrote in message
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel

The number 5 is a nicer number. Sits nicely between 1 and 10 ;)
Plus it's 1 extra than 4

Regards
Richard Grove

http://shopbuilder.org - ecommerce systems
Become a Shop Builder re-seller:
http://www.affiliatewindow.com/affil...ls.php?mid=611
http://www.affiliatewindow.com/a.pl?590

Jul 17 '05 #6

P: n/a
mi****@komatia.com (mikel) wrote in news:e93060dc.0312020504.69df1626
@posting.google.com:
php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?


OOP

--
Spam:newsgroup(at)cr*********@verisign-sux-klj.com
EMail: javascript:alert('%63%6C%62%40%63%72%61%7A%6E%61%7 2%2E%63%6F%6D');
Jul 17 '05 #7

P: n/a
"Richard Grove" <info[at]redeyemedia[dot]co[dot]uk> wrote in news:3fcca58d$0
$1***********@mercury.nildram.net:
The number 5 is a nicer number. Sits nicely between 1 and 10 ;)


I'll wait for 5.5 then.

--
Spam:newsgroup(at)cr*********@verisign-sux-klj.com
EMail: javascript:alert('%63%6C%62%40%63%72%61%7A%6E%61%7 2%2E%63%6F%6D');
Jul 17 '05 #8

P: n/a
I'd love to see some tutorial and examples using this new version of PHP,
especially with the latest MySQL4 and Apache2. Thanks
"mikel" <mi****@komatia.com> wrote in message
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel

Jul 17 '05 #9

P: n/a
Johan Holst Nielsen <jo***@weknowthewayout.com> wrote or quoted:
By the way - anyone know if any webhosting companies provide "beta"
servers with PHP5 installed for a little price?


I have a Linux/Apache server running PHP Version 5.0.0b2.

Space on it is relatively inexpensive - $4.00/Mb/Year; and there's
lots of room if you need it.

It does domain hosting and mail as well - if that's what you want;
though more facilities may cost a bit extra to set up.

Follow the instructions in my signature if you want more details.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #10

P: n/a
Useko Netsumi wrote:
I'd love to see some tutorial and examples using this new version of PHP,
especially with the latest MySQL4 and Apache2. Thanks


Anything special you want to see? :) Maybe I can write an tutorial in
the weekend then ;)

Regards,
Johan

Jul 17 '05 #11

P: n/a
André Nęss <an*********************@ifi.uio.no> schrieb:
Daniel Andislic:
new object model, exception handling, integration of gnome's xmllib2,
namespaces, interfaces..


I think they discarded namespaces :/


You are right. *sigh*

Regards,
Matthias
Jul 17 '05 #12

P: n/a

"Useko Netsumi" <us*****@yahoo.com> wrote in message
news:bq*************@ID-205437.news.uni-berlin.de...
I'd love to see some tutorial and examples using this new version of PHP,
especially with the latest MySQL4 and Apache2. Thanks


as far as I know, PHP5 currently works with SQLite for licence reasons
(MySQL AG)
Jul 17 '05 #13

P: n/a
Daniel Andislic wrote:
"Useko Netsumi" <us*****@yahoo.com> wrote in message
news:bq*************@ID-205437.news.uni-berlin.de...
I'd love to see some tutorial and examples using this new version of PHP,
especially with the latest MySQL4 and Apache2. Thanks

as far as I know, PHP5 currently works with SQLite for licence reasons
(MySQL AG)

You just have to install the mysql client to get it to work. There's
just some concerns over the MySQL licence that's all.

Jul 17 '05 #14

P: n/a
On Tue, 02 Dec 2003 14:53:50 +0000, André Nęss
<an*********************@ifi.uio.no> wrote:
Daniel Andislic:
new object model, exception handling, integration of gnome's xmllib2,
namespaces, interfaces..


I think they discarded namespaces :/


They did, which was silly.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #15

P: n/a
On Tue, 2 Dec 2003 17:37:25 +0100, "Daniel Andislic" <sr*******@gmx.net> wrote:
as far as I know, PHP5 currently works with SQLite for licence reasons
(MySQL AG)


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 (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #16

P: n/a
mi****@komatia.com (mikel) wrote in message
news:<e9**************************@posting.google. com>...

php5 is in everybodies mouth - but what are the *real* advantages
and plus' compared to php4?


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

http://www.php.net/zend-engine-2.php

Cheers,
NC
Jul 17 '05 #17

P: n/a
On Tue, 02 Dec 2003 16:43:53 -0800, Nikolai Chuvakhin wrote:
[ snip ]

but no additional
functionalilty; just another step along the way of turning PHP into a Java
clone.

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 "efficiencies" 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.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #18

P: n/a
"Useko Netsumi" <us*****@yahoo.com> wrote in message news:<bq*************@ID-205437.news.uni-berlin.de>...
I'd love to see some tutorial and examples using this new version of PHP,
especially with the latest MySQL4 and Apache2. Thanks
"mikel" <mi****@komatia.com> wrote in message
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel


Hi,

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

http://www.php.net/zend-engine-2.php

rahul
Jul 17 '05 #19

P: n/a
"Nikolai Chuvakhin" <nc@iname.com> wrote in message
news:32**************************@posting.google.c om...
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,


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
--
http://www.templatetamer.com/
Jul 17 '05 #20

P: n/a
With total disregard for any kind of safety measures nc@iname.com
(Nikolai Chuvakhin) leapt forth and uttered:
If you understand OOP, you will still be
wondering how much sense OOP makes without strong typing.
SmallTalk is regarded as one of the most Object Oriented languages
available. It does not use strong typing, but dynamic types. Just
like PHP.
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.


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

--
There is no signature.....
Jul 17 '05 #21

P: n/a
Nikolai Chuvakhin <nc@iname.com> wrote or quoted:
mi****@komatia.com (mikel) wrote:

php5 is in everybodies mouth - but what are the *real* advantages
and plus' compared to php4?


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.


Better an unencumbered Java clone than a hastily-hacked-together
scripting language, hey?
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #22

P: n/a
Nikolai Chuvakhin wrote:
just another step along the way
of turning PHP into a Java clone.


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

Jul 17 '05 #23

P: n/a
Keith Bowes <do****@spam.me> wrote or quoted:
We have to learn Java somehow, and we sure can't via Sun's tutorial. :)


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/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #24

P: n/a
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_changed;
private $primary_key;

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

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

function __set($name, $value) {
if($this->values[$name] != $value) {
$this->values[$name] = $value;
$this->columns_changed[] = $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 htmlspecialchars() 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>" .
htmlspecialchars($msg->title) . "</h1>" ). In PHP5, you can modify __get()
like this:

function __get($name) {
if(substr($name, -5) == '_html')) {
$need_htmlspecialchars = true;
$name = substr($name, 0, -5);
}
$value = $this->values[$name];
if($need_htmlspecialchars) {
$value = htmlspecialchars($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" <mi****@komatia.com> napisal w wiadomosci
news:e9**************************@posting.google.c om...
Hello,

php5 is in everybodies mouth - but what are the *real* advantages and
plus' compared to php4?

mikel

Jul 17 '05 #25

P: n/a
"rush" <pi**@rush.avalon.hr> wrote in message
news:<bq*********@ls219.htnet.hr>...
"Nikolai Chuvakhin" <nc@iname.com> wrote in message
news:32**************************@posting.google.c om...
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,


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.


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

Cheers,
NC
Jul 17 '05 #26

P: n/a
Phil Roberts <ph*****@HOLYflatnetSHIT.net> wrote in message
news:<Xn*************************@206.127.4.22>...
With total disregard for any kind of safety measures nc@iname.com
(Nikolai Chuvakhin) leapt forth and uttered:
another step along the way of turning PHP into a Java clone.


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


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
Jul 17 '05 #27

P: n/a
Tim Tyler <ti*@tt1lock.org> wrote in message
news:<Hp********@bath.ac.uk>...

It's curious how Apache are supporting both Java and PHP.
It must produce some level of schizophrenia internally.


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
Jul 17 '05 #28

P: n/a
Nikolai Chuvakhin <nc@iname.com> wrote or quoted:
Tim Tyler <ti*@tt1lock.org> wrote in message

It's curious how Apache are supporting both Java and PHP.
It must produce some level of schizophrenia internally.


No it shouldn't. Apache simply decides which module to call
to parse a file with a particular extension. [...]


I mean within the Apache Software Foundation - e.g. when it comes
to allocating funds.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #29

This discussion thread is closed

Replies have been disabled for this discussion.