Introdução ao Zend Framework

 Conhecendo o Zend Framework


 Referência do Zend Framework

  • Zend_Gdata
  • Zend_Http
  • Zend_InfoCard
  • Zend_Json
  • Zend_Layout
  • Zend_Ldap
  • Zend_Loader
  • Zend_Locale
  • Zend_Log
  • Zend_Mail
  • Zend_Markup
  • Zend_Measure
  • Zend_Memory
  • Zend_Mime
  • Zend_Navigation
  • Zend_Oauth
  • Zend_OpenId
  • Zend_Paginator
  • Zend_Pdf
  • Zend_ProgressBar
  • Zend_Queue
  • Zend_Reflection
  • Zend_Registry
  • Zend_Rest

  • Zend_Search_Lucene
  • Zend_Serializer
  • Zend_Server
  • Zend_Service
  • Zend_Session
  • Zend_Soap
  • Zend_Tag
  • Zend_Test
  • Zend_Text
  • Zend_TimeSync
  • Zend_Tool
  • Zend_Tool_Framework
  • Zend_Tool_Project
  • Zend_Translate
  • Zend_Uri
  • Zend_Validate
  • Zend_Version
  • Zend_View
  • Zend_Wildfire
  • Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Translation 12.2% Update 2011-11-16 - Revision 24447 - Version ZF 1.11.x

    Capítulo 28. Zend_Debug

    28.1. Dumping Variables

    The static method Zend_Debug::dump() prints or returns information about an expression. This simple technique of debugging is common because it is easy to use in an ad hoc fashion and requires no initialization, special tools, or debugging environment.

    Exemplo 28.1. Example of dump() method

    Zend_Debug::dump($var$label null$echo true);

    The $var argument specifies the expression or variable about which the Zend_Debug::dump() method outputs information.

    The $label argument is a string to be prepended to the output of Zend_Debug::dump(). It may be useful, for example, to use labels if you are dumping information about multiple variables on a given screen.

    The boolean $echo argument specifies whether the output of Zend_Debug::dump() is echoed or not. If TRUE, the output is echoed. Regardless of the value of the $echo argument, the return value of this method contains the output.

    It may be helpful to understand that Zend_Debug::dump() method wraps the PHP function var_dump(). If the output stream is detected as a web presentation, the output of var_dump() is escaped using htmlspecialchars() and wrapped with (X)HTML <pre> tags.

    [Dica] Debugging with Zend_Log

    Using Zend_Debug::dump() is best for ad hoc debugging during software development. You can add code to dump a variable and then remove the code very quickly.

    Also consider the Zend_Log component when writing more permanent debugging code. For example, you can use the DEBUG log level and the stream log writer to output the string returned by Zend_Debug::dump().

    digg delicious meneame google twitter technorati facebook