From 2f3489a8f2054a27f39eedf55dfdbe36ff302c81 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sun, 27 Mar 2016 17:28:50 +0200 Subject: [PATCH] debug,pr,pj return submitted var #3860 3.x -> 3.3 https://github.com/cakephp/docs/pull/3860 Also changed order of debug/pr/pj so that debug/pr/pj are close to each other as they do the same thing and there was no order by alphabet before, either. --- .../global-constants-and-functions.rst | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/en/core-libraries/global-constants-and-functions.rst b/en/core-libraries/global-constants-and-functions.rst index aadb8cb856..b07899ab7f 100644 --- a/en/core-libraries/global-constants-and-functions.rst +++ b/en/core-libraries/global-constants-and-functions.rst @@ -97,6 +97,10 @@ such as debugging and translating content. .. php:function:: debug(mixed $var, boolean $showHtml = null, $showFrom = true) + .. versionadded:: 3.3.0 + Calling this method will return passed ``$var``, so that you can, for instance, + place it in return statements. + If the core ``$debug`` variable is ``true``, ``$var`` is printed out. If ``$showHTML`` is ``true`` or left as ``null``, the data is rendered to be browser-friendly. @@ -104,6 +108,26 @@ such as debugging and translating content. which it was called. Also see :doc:`/development/debugging` +.. php:function:: pr(mixed $var) + + .. versionadded:: 3.3.0 + Calling this method will return passed ``$var``, so that you can, for instance, + place it in return statements. + + Convenience wrapper for ``print_r()``, with the addition of + wrapping ``
`` tags around the output.
+
+.. php:function:: pj(mixed $var)
+
+    .. versionadded:: 3.3.0
+        Calling this method will return passed ``$var``, so that you can, for instance,
+        place it in return statements.
+
+    JSON pretty print convenience function, with the addition of
+    wrapping ``
`` tags around the output.
+
+    It is meant for debugging the JSON representation of objects and arrays.
+
 .. php:function:: env(string $key, string $default = null)
 
     .. versionadded:: 3.1.1
@@ -135,18 +159,6 @@ such as debugging and translating content.
 
     Commonly used like ``list($namespace, $className) = namespaceSplit('Cake\Core\App');``
 
-.. php:function:: pr(mixed $var)
-
-    Convenience wrapper for ``print_r()``, with the addition of
-    wrapping ``
`` tags around the output.
-
-.. php:function:: pj(mixed $var)
-
-    JSON pretty print convenience function, with the addition of
-    wrapping ``
`` tags around the output.
-
-    It is meant for debugging the JSON representation of objects and arrays.
-
 Core Definition Constants
 =========================