Ich hab jetzt mal im xampp auf php5 umgeschaltet und werde mit folgenden Problemen bei PEAR konfrontiert:
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /xxx/PEAR.php on line 252
[2048] Assigning the return value of new by reference is deprecated
file: /xxx/DB.php -> line: 470
Gibt es eine Version von PEAR, die php5 kompatibel ist, oder muss man das alles per Hand umstellen? Irgendwo hab ich was mit error reporting gefunden, aber mit
if (version_compare(phpversion(), "5.0.0") == -1)
error_reporting(E_ALL);
else
error_reporting(E_ALL | E_STRICT);
komm ich auch zu keinem besseren Ergebnis. Hat jemand Erfahrungen mit PEAR und php5?
Thanx.
P.S.: Kann es wirklich sein, dass das die einzig wahre Möglichkeit ist?!
Zitat von http://www.issociate.de/board/post/184979/Pear_DB_class_not_PHP5_strict_compatible?.htmlAlles anzeigen
PEAR uses a lot of (IMHO ugly) hacks to circumvent bugs in (very) early
php versions. Back when PHP 4 was released there was a bug with
assigning objects to variables, at a certain point people found out that
by using $a &= new class; circumvented that bug, and didn't pose any
real problem in later versions, so PEAR uses that still. As of PHP
5.0.0, this is considered bad behaviour, but since PEAR should be usable
for old versions of PHP aswell, it still keeps this syntax.I personally find most PEAR packages extremely bloated, and badly coded,
but that's just a personal opinion. However, you can edit the package
yourself and replace the &= new to = new
P.P.S: Hab jetzt noch weiter gesucht ... und folgere daraus, dass es nur auf die richtigen Einstellungen des error reportings ankommt ... welches Level muss man aber optimalerweise wählen? Ideen?
Zitat von http://www.sitepoint.com/blog-post-view.php?id=234249
he switch from PHP4 to PHP5 required changing a total of 8 lines of code in some of the core components, plus adding a new compatibility function that detects the PHP version and will define a clone() function in case the server still runs PHP4 - so until we start using the exception handling, which is planned for the next versions, we can even switch between PHP4 and 5 seamlessly.Really, it ain't such a big deal.
Here's a list of some of the PEAR packages we're using, if they're on your list as well, you know those can be safely used with PHP5 (unless in E_STRICT):
- DB (with MySQL and MSSQL drivers) - DB_DataObject (if you use the old $obj->__clone() method to copy objects, you'll need to change this to use PHP5's new clone() function, and provide a user-defined one when running PHP4, in case you need that backwards-compatibility. This is *not much work* - trust me :-)) - DB_DataObject_FormBuilder - HTML_Template_Sigma - Payment_DTA - Spreadsheet_Excel_Writer - Cache_Lite - Date - HTML_QuickForm - HTML_TreeMenu - Image_Transform - LiveUser - Mail && Mail_Mime - Services_ExchangeRates - Validate