[PHP] Re: php 4 and 5
Haydar Tuna [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. Technically this is incorrect. PHP 4 does provide basic support for OOP, but PHP 5 provides better support. -- Tony Marston http://www.tonymarston.net http://www.radicore.org PHP 5 also supports more library than PHP 4.:) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear All, What different between 4 and 5 ? Edward. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php 4 and 5
Hello, I haven't explain this topic clearly. I'm sorry. Both PHP 5 and PHP 4 support OOP features but PHP 5 support more OOP features than PHP 4 and version of PHP is 5 now. As you know, 5 is bigger than 4 :))). PHP 5 is very comfortable and easy to use. PHP 5 supports more library than PHP 4 and so on:))) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net Tony Marston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Haydar Tuna [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. Technically this is incorrect. PHP 4 does provide basic support for OOP, but PHP 5 provides better support. -- Tony Marston http://www.tonymarston.net http://www.radicore.org PHP 5 also supports more library than PHP 4.:) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear All, What different between 4 and 5 ? Edward. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php 4 and 5
Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. PHP 5 also supports more library than PHP 4.:) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear All, What different between 4 and 5 ? Edward. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
On Mon, 2007-03-12 at 10:21 +0200, Haydar Tuna wrote: Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. I think you mean supports more OOP features. PHP4 had plenty of OOP support also. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
Hello, Yes, you are right I mean supports more OOP features. PHP 5 support more OOP features than PHP 4. :) -- Haydar TUNA Republic Of Turkey - Ministry of National Education Education Technology Department Ankara / TURKEY Web: http://www.haydartuna.net Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 2007-03-12 at 10:21 +0200, Haydar Tuna wrote: Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. I think you mean supports more OOP features. PHP4 had plenty of OOP support also. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
Robert Cummings escribió: On Mon, 2007-03-12 at 10:21 +0200, Haydar Tuna wrote: Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. I think you mean supports more OOP features. PHP4 had plenty of OOP support also. But it was quite crappy. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
On Mon, 2007-03-12 at 14:18 -0300, Martin Marques wrote: Robert Cummings escribió: On Mon, 2007-03-12 at 10:21 +0200, Haydar Tuna wrote: Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. I think you mean supports more OOP features. PHP4 had plenty of OOP support also. But it was quite crappy. Don't blame the tool. I've never had a problem with the amount of OOP support in PHP4. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
Robert Cummings escribió: On Mon, 2007-03-12 at 14:18 -0300, Martin Marques wrote: But it was quite crappy. Don't blame the tool. I've never had a problem with the amount of OOP support in PHP4. That's just taste. I started feeling very comfortable when I got to use constructors, destructors (very important, especially when dealing with DB objects), and even more with __autoload() and clone (referencing by default was a great thing). I have to say, life is easier with PHP5 :-) -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php 4 to 5
Travis Conway wrote: I do not know much about the history of php and do not know why there is active development on both the 4 and 5 major versions, but is there a definite reason for me to migrate from 4 to 5 on my servers? Depends on what you wish to do with php. PHP 5 has far better support for xml and soap than php 4. It has a stricter object model and supports native exceptions for error handling. Iterators, reflection, and __call()/__get()/__set() provide incredibly flexibility. It is new, and so not nearly as stable as PHP 4. Any solutions would need to be custom-written for PHP 5 at this point, although options are beginning to appear. PHP 4 has a big history and is very stable. There are shortcomings that are addressed in PHP 5, but there is a huge codebase. So, the question is, do you rely on other people's code, or your own? If you rely on other people's code, I would wait a year or two to upgrade. Otherwise, what are you waiting for? :) Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 to 5
Well, I look at other people's code sice I am new to the whole language. I have only been working with it for about a month and half now. I do have prior experience with languages such as ASP (both JScript and VBscript based). I am probably not going to upgrade now since my stuff just works. I was just wondering what would be the main advantage. - Original Message - From: Greg Beaver [EMAIL PROTECTED] To: Travis Conway [EMAIL PROTECTED] Cc: PHP-GEMERAL [EMAIL PROTECTED] Sent: Sunday, November 28, 2004 6:15 PM Subject: [PHP] Re: php 4 to 5 Travis Conway wrote: I do not know much about the history of php and do not know why there is active development on both the 4 and 5 major versions, but is there a definite reason for me to migrate from 4 to 5 on my servers? Depends on what you wish to do with php. PHP 5 has far better support for xml and soap than php 4. It has a stricter object model and supports native exceptions for error handling. Iterators, reflection, and __call()/__get()/__set() provide incredibly flexibility. It is new, and so not nearly as stable as PHP 4. Any solutions would need to be custom-written for PHP 5 at this point, although options are beginning to appear. PHP 4 has a big history and is very stable. There are shortcomings that are addressed in PHP 5, but there is a huge codebase. So, the question is, do you rely on other people's code, or your own? If you rely on other people's code, I would wait a year or two to upgrade. Otherwise, what are you waiting for? :) Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php 4 to 5
Travis Conway wrote: I do not know much about the history of php and do not know why there is active development on both the 4 and 5 major versions, but is there a definite reason for me to migrate from 4 to 5 on my servers? Trav here can help you . http://www.php.net/manual/en/history.php http://www.php.net/manual/en/migration5.php http://www.php.net/manual/en/language.oop.php http://www.php.net/manual/en/language.oop5.php -- -- ShenKong ([EMAIL PROTECTED]) -- http://www.openphp.cn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 to 5
Travis Conway wrote: Well, I look at other people's code sice I am new to the whole language. I have only been working with it for about a month and half now. I do have prior experience with languages such as ASP (both JScript and VBscript based). I am probably not going to upgrade now since my stuff just works. I was just wondering what would be the main advantage. I switched to PHP over a year ago, and decided that as I was just starting I'd work with PHP5 from day one. The production releases just about kept pace with what I had to ship ( couple of sites used RC without problems for a while ). If you ARE just starting then while the volume of PHP4 code is nice, working clean with PHP5 is not a problem. All my stuff 'borrows' from PHP4 without any problem, and I am learning quickly how to switch to tidier PHP5 'rules'. I actually bought a book to help - Advanced PHP Programming by George Schlossnagle - from which I've had to rewrite some of the stuff to dump the MySQL crap ;) but gives a good grounding in getting things right. -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 4 to 5 class issues involving static methods and $this
Chris wrote: I have a class where I need to be able to use the methods as static methods as well as using them inside an initialized class. Here's an example of what I need to do: class my_class { var $elements = array(); // holds all of my elements function format_string($string) { // format the string... return $this-elements[] = $string; } function show_all() { return implode(\n, $this-elements); } } This worked fine in PHP 4. It silently ignored the $this-elements[] assignment in statically called methods and just returned my formatted string without any fuss. However, in PHP 5, I understand that I'm now required to declare the method format_string as public static if I want to just call my_class::format_string(), and if I want to use $elements inside a static method, it also requires being declared as static. I also understand that I can't use $this inside a statically called method. I've tried these things, but they don't seem to help. How can I rewrite my class for PHP 5 to emulate the functionality I had in PHP 4 in an error free way? ?php abstract class static_my_class { public static function format_string($string) { } } class my_class { var $elements = array(); public function __call($method, $args) { try { $rm = new ReflectionMethod('static_my_class', $method); return $this-elements[] = $rm-invoke(null, $args); } catch (ReflectionException $e) {} } } static_my_class::format_string('a'); $a = new my_class; $a-format_string('a'); ? Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php