PHP: apd_croak - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

apd_dump_function_table apd_continue

Last updated: Sat, 27 Jan 2007

view this page in

# apd_croak

(no version information, might be only in CVS)

apd_croak -- Throw an error, a callstack and then exit

## Описание

void apd_croak ( string warning [, string delimiter] )

Behaves like perl's Carp::croak. Throw an error, a callstack and then exit.

## Список параметров

`warning`

  The warning to throw.

`delimiter`

  The delimiter. Default to `<BR />`.

## Возвращаемые значения

Эта функция не возвращает значения после выполнения.

## Примеры

Пример 1. apd_croak() example

`<?php apd_croak("Some Warning","<P>"); ?>`

## Смотрите также

apd_clunk()

add a note User Contributed Notes
apd_croak
php at peous dot com
05-Jul-2005 12:18
`// A function that "ASSERTS", ie that dies if the boolean in parameter is false
// ex: verify( $myDatabase->Connect() );
function verify( $bResult )
{
if (!bResult)
{
echo "<hr><h1>ERROR</h1><hr>";
echo "<pre>Last call arguments:\n";
for($i=0;$i<func_num_args();$i++)
{ echo "&rarr;";
print_r( func_get_arg ($i) );
echo "&larr;\n";
}
if (sizeof($_GET))
{ echo "<hr>GET VARS\n";
print_r( $_GET );
}
if (sizeof($_POST))
{ echo "<hr>POST VARS\n";
print_r( $_POST );
}
if (sizeof($_SERVER))
{ echo "<hr>SERVER VARS\n";
print_r( $_SERVER );
}
if (sizeof($_COOKIE ))
{ echo "<hr>COOKIE VARS\n";
print_r( $_COOKIE );
}
// Disable if not on a protected server
if (sizeof($_SESSION ))
{ echo "<hr>SESSION VARS\n";
print_r( $_SESSION );
}
echo "</pre>";
echo "<hr>";
if (function_exists("apd_callstack"))
{ apd_croak("Error !");
}
else
{ die(1);
}
}
}`
add a note
apd_dump_function_table apd_continue

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST