On Mon, Feb 22, 2010 at 5:13 PM, Hector Virgen <[email protected]> wrote:
> It's amazing what a simple "@" can do to a line of code in PHP :)
> hvir...@hector-mac:~/Web/library/ZendFramework-1.10.1$ svn diff -r
> 20701:21134 library/Zend/Dom/Query.php
> Index: library/Zend/Dom/Query.php
> ===================================================================
> --- library/Zend/Dom/Query.php
> (.../branches/release-1.10/library/Zend/Dom/Query.php) (revision 20701)
> +++ library/Zend/Dom/Query.php
> (.../tags/release-1.10.1/library/Zend/Dom/Query.php) (revision 21134)
> @@ -178,12 +178,12 @@
>          $type   = $this->getDocumentType();
>          switch ($type) {
>              case self::DOC_XML:
> -                $success = @$domDoc->loadXML($document);
> +                $success = $domDoc->loadXML($document);
>                  break;
>              case self::DOC_HTML:
>              case self::DOC_XHTML:
>              default:
> -                $success = @$domDoc->loadHTML($document);
> +                $success = $domDoc->loadHTML($document);
>                  break;
>          }
> So this explains why it worked in 1.10.0 and not in 1.10.1. Since PHPUnit
> automatically promotes all warnings to exceptions, errors in loading the
> HTML causes PHPUnit tests to fail.
> As mentioned in the DOMDocument documentation (ha, what a mouthful!),
> perhaps ZF should be handling these errors with a custom error handler:
> http://us3.php.net/manual/en/domdocument.loadhtml.php
> It seems the issue tracker is being worked on at the moment so I'll wait
> until later to file the bug.
> --
> Hector

I recently reported a similar issue (that has since been fixed) with
Zend_Db_Adapter_Sqlsrv. In my case, it was a warning being generated
by the DB adapter constructor that was raising an exception inside a
custom error handler in Zend_Session. There are a number of places
where ZF classes use the error control operator on function calls to
suppress errors or warnings. A problem arises when this happens inside
the scope of one of a handful of methods that defines a custom error
handler to deal with their own errors and/or warnings.

I'm not sure what the best solution is to deal with this, but I think
it could use some attention.

Andrew

Reply via email to