note 61277 added to function.assert-options

From: Date: Mon, 30 Jan 2006 05:07:48 +0000
Subject: note 61277 added to function.assert-options
Groups: php.notes 
Request: Send a blank email to php-notes+get-102706@lists.php.net to get a copy of this message
assert_options(ASSERT_CALLBACK, ...) can take a class function. Second parameter needs to be an array, first entry is the classname, followed by the functionname. Example: <?php assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_CALLBACK, array('a', 'assert')); class a { static function assert($file, $line, $code) { '<div style="border: thin dashed #999; background-color:#ccc"><h4>Assertion thrown</h4> <p>File: ' . $file . '<br/>Line: ' . $line . '<br/>Code: ' . $code . '</p></div>'; } } assert ('1 == 0'); ?> ---- Server IP: 140.113.54.119 Probable Submitter: 218.169.228.68 ---- Manual Page -- http://www.php.net/manual/en/function.assert-options.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61277 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61277&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61277&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102706) next »