function Error::currentErrorHandler

Returns the current PHP error handler as a callable.

Return value

callable|null The current error handler as a callable, or NULL if none is set.

4 calls to Error::currentErrorHandler()
DrupalKernelTest::tearDown in core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
ExpectDeprecationTrait::setUpErrorHandler in core/tests/Drupal/TestTools/Extension/DeprecationBridge/ExpectDeprecationTrait.php
Sets up the test error handler.
ExpectDeprecationTrait::tearDownErrorHandler in core/tests/Drupal/TestTools/Extension/DeprecationBridge/ExpectDeprecationTrait.php
Tears down the test error handler.
TestRunnerKernel::boot in core/lib/Drupal/Core/Test/TestRunnerKernel.php
Boots the current kernel.

File

core/lib/Drupal/Core/Utility/Error.php, line 215

Class

Error
Drupal error utility class.

Namespace

Drupal\Core\Utility

Code

public static function currentErrorHandler() : ?callable {
    $currentHandler = set_error_handler('var_dump');
    restore_error_handler();
    return $currentHandler;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.