From e2a2bcc1a2aa7476b4f6fec3ee6207b7a4ee5bf5 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sat, 3 Jan 2004 14:00:52 +0000 Subject: [PATCH] - Update docs on the three var dumping functions git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@147762 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/var/functions/print-r.xml | 5 ++++- reference/var/functions/var-dump.xml | 20 +++++++++++++------- reference/var/functions/var-export.xml | 16 +++++++++------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/reference/var/functions/print-r.xml b/reference/var/functions/print-r.xml index 737a473b03..68ef762843 100644 --- a/reference/var/functions/print-r.xml +++ b/reference/var/functions/print-r.xml @@ -1,5 +1,5 @@ - + @@ -27,6 +27,9 @@ printed. If given an array, values will be presented in a format that shows keys and elements. Similar notation is used for objects. + print_r and var_export will + also show protected and private properties of objects with PHP 5, on the + contrary to var_dump. Remember that print_r will move the array diff --git a/reference/var/functions/var-dump.xml b/reference/var/functions/var-dump.xml index 26ba7d17c7..d49b04a99c 100644 --- a/reference/var/functions/var-dump.xml +++ b/reference/var/functions/var-dump.xml @@ -1,5 +1,5 @@ - + @@ -16,14 +16,16 @@ This function displays structured information about one or more - expressions that includes its type and value. Arrays are explored - recursively with values indented to show structure. + expressions that includes its type and value. Arrays and objects are + explored recursively with values indented to show structure. + + + In PHP only public properties of objects will be returned in the output. + var_export and print_r will + also return protected and private properties. + &tip.ob-capture; - - Compare var_dump to - print_r. - <function>var_dump</function> example @@ -79,6 +81,10 @@ bool(true) + + See also var_export and + print_r. + diff --git a/reference/var/functions/var-export.xml b/reference/var/functions/var-export.xml index 706c153bc0..7fe4cf51d1 100644 --- a/reference/var/functions/var-export.xml +++ b/reference/var/functions/var-export.xml @@ -1,10 +1,10 @@ - + var_export - Outputs or returns a string representation of a variable + Outputs or returns a parsable string representation of a variable Description @@ -16,16 +16,14 @@ This function returns structured information about the variable that is passed to this function. It is similar to var_dump - with the exception that the returned representation is valid PHP code. + with two exceptions. The first one is that the returned representation is + valid PHP code, the second that it will also return protected and private + properties of an object with PHP 5. You can also return the variable representation by using &true; as second parameter to this function. - - Compare var_export to - var_dump. - @@ -74,6 +72,10 @@ echo $v; + + See also var_export and + print_r. +