From dd9fa0aed7377da913904e3d26d59a22bec69015 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Mon, 3 Sep 2012 02:24:31 +0000 Subject: [PATCH] Fix doc bug #62986 (Second parameter for assert()), along with a couple of other unrelated fixes (making the hyphen that should be a dash into an em dash, adding a full stop, using consistently). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@327439 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/info/functions/assert.xml | 87 +++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 4 deletions(-) diff --git a/reference/info/functions/assert.xml b/reference/info/functions/assert.xml index 0bfa78b3be..fb38fe6b94 100644 --- a/reference/info/functions/assert.xml +++ b/reference/info/functions/assert.xml @@ -11,6 +11,7 @@ boolassert mixedassertion + stringdescription assert will check the given @@ -50,8 +51,8 @@ The assert_options function and/or - ASSERT_CALLBACK configuration directive allow a callback function - to be set to handle failed assertions. + ASSERT_CALLBACK configuration directive allow a + callback function to be set to handle failed assertions. assert callbacks are particularly useful for @@ -66,8 +67,11 @@ argument will contain the file the assertion failed in. The second argument will contain the line the assertion failed on and the third argument will contain the expression that failed (if - any - literal values such as 1 or "two" will not be passed via - this argument) + any — literal values such as 1 or "two" will not be passed via + this argument). Users of PHP 5.4.8 and later may also provide a fourth + optional argument, which will contain the + description given to assert, if + it was set. @@ -83,6 +87,15 @@ + + description + + + An optional description that will be included in the failure message if + the assertion fails. + + + @@ -94,6 +107,33 @@ + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.4.8 + + The description parameter was added. The + description is also now provided to a callback + function in ASSERT_CALLBACK mode as the fourth + argument. + + + + + + + + &reftitle.examples; @@ -126,6 +166,45 @@ assert('mysql_query("")'); + + + Using a custom handler to print a description + + +]]> + + &example.outputs; + + + + +