Reply to Re: Pear DB class not PHP5 strict compatible?

Your name:

Reply:


Posted by M. Sokolewicz on 03/07/05 15:49

Richard Davey wrote:
> Hi,
>
> Having heard good things about the PEAR DB package I wanted to try
> it out on a new project. I'm using PHP 5.0.3, ran the go-pear and
> installed the latest version but upon including it in my script it
> brings up rafts of errors such as:
>
> Strict Standards: Assigning the return value of new by reference is deprecated in D:\dev\php-5.0.3\PEAR\DB.php on line 470
>
> I run PHP with E_ALL | E_STRICT because it's the best way for me to
> catch all errors and keep my code sensible - do the Pear packages
> not also work in this environment or am I just out of luck re: the
> DB package itself?
>
> It included and worked fine when I switched to PHP 4, but that
> isn't an option for this project.
>
> Best regards,
>
> Richard Davey
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 :)

- tul

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация