Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Go PHP 5

PHP 4 has served the web developer community for seven years now, and served it well. However, it also shows its age. Most of PHP 4's shortcomings have been addressed by PHP 5, released three years ago, but the transition from PHP 4 to PHP 5 has been slow for a number of reasons.

PHP developers cannot leverage PHP 5's full potential without dropping support for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and users would then be forced to switch to a different application. Web hosts cannot upgrade their servers to PHP 5 without making it impossible for their users to run PHP 4-targeted web apps, and have no incentive to go to the effort of testing and deploying PHP 5 while most web apps are still compatible with PHP 4 and the PHP development team still provides maintenance support for PHP 4. The PHP development team, of course, can't drop maintenance support for PHP 4 while most web hosts still run PHP 4.

It is a dangerous cycle, and one that needs to be broken. The PHP developer community has decided that it is indeed now time to move forward, together. Therefore, the listed software projects have all agreed that effective February 5th, 2008, any new feature releases will have a minimum version requirement of at least PHP 5.2.0. Furthermore, the listed web hosts have agreed that effective February 5th, 2008, they will include PHP 5.2 (or a more recent version) in their service offer.

It is our belief that this will provide web hosts reason to upgrade and the PHP development team the ability to retire PHP 4 and focus efforts on PHP 5 and the forthcoming PHP 6, all without penalizing any existing project for being "first out of the gate".

List projects already committed to the switch, including big names like Phpmyadmin, Pear, Gallery, Typo3 and Drupal.
http://gophp5.org/projects

Support GoPHP5.org


Should vanilla join this campaign

Comments

  • Options
    edited September 2007
    Mark didn't take any decision about keeping the core php4 compatible for Vanilla 2.

    The advantage of dropping php4 support for the core would be mainly a cleaner api (object passed by reference, magic methods...).

    The better support for xml and other php5 feature would be great for extensions; but not so much necessary for the core.

    The disadvantage of dropping php4 support is that Vanilla 2 wouldn't be compatible on some host and that some user would have to change of host.
  • Options
    My personal opinion is that for the user, php5.2 only support is one more thing to worry about. For the developer, that would mean more features, less code and less testing.
    Since Vanilla users are for most them, I believe, developer, we should switch to php5 only support.
  • Options
    My vote for php5 only.
  • Options
    Gets my vote. Most hosts support PHP5 and have how to activate it (if it isn't by default) in their FAQs — so not exactly hard for the forum owners to sort out.

    Sounds like PHP5 is better pretty much all round, and dropping PHP4 support would help keep things minimal and clean — the core of what Vanilla is surely?
  • Options
    Same here, go php5 :) @Dinoboff: If this campaign works all hosters will upgrade to php 5.2 by february
  • Options
    edited October 2007
    Here what could look likes the Delegation class in php 5:class Delegation { private static $DelegateCollection = array(); public $Name; public $DelegationParameters = array(); static function AddDelegate($ClassName, $DelegateName, $DelegateFnc) { if (!array_key_exists($ClassName, self::$DelegateCollection)) { self::$DelegateCollection[$ClassName] = array(); } if (!array_key_exists($DelegateName, self::$DelegateCollection[$ClassName])) { self::$DelegateCollection[$ClassName][$DelegateName] = array(); } self::$DelegateCollection[$ClassName][$DelegateName][] = $DelegateFnc; } static function CallDelegate($Instance, $DelegateName) { if ($Instance->Name && !empty($Instance->Name) ){ $ClassName = $Instance->Name; } else { $ClassName = get_class($Instance); } if (array_key_exists($ClassName, self::$DelegateCollection) && array_key_exists($DelegateName, self::$DelegateCollection[$ClassName]) ){ foreach (self::$DelegateCollection[$ClassName][$DelegateName] as $DelegateFnc) { if (function_exists($DelegateFnc)) { $DelegateFnc($Instance); } } } } protected function _CallDelegate($DelegateName) { self::CallDelegate($this, $DelegateName); } }

    It is easier to use since you don't have to feed your classes with the Context object:class Example extends Delegation { function __construct() { $this->Name = 'Example'; } function test() { $this->_CallDelegate('test'); } } function ExampleDelegation($Example) { echo "Example object is calling ExampleDelegation<br/>"; } Delegation::AddDelegate('Example', 'test', 'ExampleDelegation'); $Example = new Example(); $Example->test(); // output "Example object is calling ExampleDelegation<br/>" class OtherExample { function test() { Delegation::CallDelegate($this, 'test'); } } function OtherExampleDelegation() { echo "OtherExample object is calling OtherExampleDelegation<br/>";; } Delegation::AddDelegate('OtherExample', 'test', 'OtherExampleDelegation'); $OtherExample = new OtherExample(); $OtherExample->test(); // output "OtherExample object is calling OtherExampleDelegation<br/>"
  • Options
    For those of us who are at the mercy of our hosting company, will there be a huge impact when they move to PHP 5 from PHP 4?

    I understand it depends on the complexity of current scripts being used, but would current (simple) PHP 4 scripts be reasonably expected to continue working under PHP 5?
  • Options
    edited October 2007
    yes reasonably expected to work
    Not all php4 functions are supported in PHP5, or behave the same in php 5, So minor adjustments will be required to your php 4 code. You won't need a major overhaul of your code. although that would be a good for the future if you atleast rewrite your code to be strict php5 compliant and leverage its unique capabilities. After all PHP 6 is just around the corner.

    From PHP website
    Today it is exactly three years ago since PHP 5 has been released. In those three years it has seen many improvements over PHP 4. PHP 5 is fast, stable & production-ready and as PHP 6 is on the way, PHP 4 will be discontinued.

    The PHP development team hereby announces that support for PHP 4 will continue until the end of this year only. After 2007-12-31 there will be no more releases of PHP 4.4. We will continue to make critical security fixes available on a case-by-case basis until 2008-08-08. Please use the rest of this year to make your application suitable to run on PHP 5.

    For documentation on migration for PHP 4 to PHP 5, we would like to point you to our migration guide. There is additional information available in the PHP 5.0 to PHP 5.1 and PHP 5.1 to PHP 5.2 migration guides as well.
  • Options
    edited October 2007
    Most company will keep php4 support.

    With media temple you can set per domain (from the control panel) or per directory (you have to set it manually with .htaccess) which version of php to use.

    For Plesk version 8.21, you can set the version per domain. And since Centos 4.4, you can install php 5.1.6; I guess that should be the version for Plesk.

    I don't know for cPanel, but they should have this option.

    So provider can easily migrate to php5 without their users noticing it. Current user can get php4 enable by default and the option to enable php5. New user would have the opposite: php5 by default with the option to enable php4.
  • Options
    Quote: Dinoboff
    pic So provider can easily migrate to php5 without their users noticing it. pic
    So right mate, I asked my host about it and they said...

    "PHP 5.2.4 has been installed the server where your account is located. It will be in use by default, given that none of the .htaccess files on your account reference a CGI version of PHP."

    So all of my scripts appear to work with PHP 5!

    Actually now that I think about it, one of my scripts that used globals stopped working a few months back, I had to add this to fix it...
    foreach($_POST AS $key => $value) { ${$key} = $value; } foreach($_GET AS $key => $value) { ${$key} = $value; }
    Maybe this was when they switched to PHP5?

    Posted: Saturday, 20 October 2007 at 8:09AM

  • Options
    Yeah, you are right. And you should fix your script rather that adding this "fix" ;-)
  • Options
    I'm no PHP guru mate, let alone a PHP5 expert.
    I did a search for the error I was getting and added the above snippet as suggested, it worked, job done!

    Posted: Tuesday, 23 October 2007 at 5:37AM

This discussion has been closed.