Files
Daniel Scherzer 886ee6d981 Zend/tests: organize some tests with sub directories (11) (#22731)
Add directories for tests relating to
- `break` statements
- functions with by-ref returns
- `class_exists()`
- dynamic properties
- error handlers
- error suppression with `@`
- `get_object_vars()`
- `highlight_string()` and `highlight_file()`
- interfaces
- `is_callable()`
- iterators
- shutdown functions
- streams

As well as organizing a couple of tests into existing sub directories along the
way

Work towards GH-15631
2026-09-30 15:52:59 +01:00

51 lines
968 B
PHP

--TEST--
Bug #46241 (error handler stacks)
--FILE--
<?php
class ErrorHandling
{
public function errorHandler1( $errno, $errstr )
{
echo "Caught on first level: '$errstr'\n";
return true;
}
public function errorHandler2( $errno, $errstr )
{
echo "Caught on second level: '$errstr'\n";
return true;
}
}
$err = new ErrorHandling();
set_error_handler( array( $err, 'errorHandler1' ) );
set_error_handler( array( $err, 'errorHandler2' ) );
trigger_error( 'Foo', E_USER_WARNING );
function errorHandler1( $errno, $errstr )
{
echo "Caught on first level: '$errstr'\n";
return true;
}
function errorHandler2( $errno, $errstr )
{
echo "Caught on second level: '$errstr'\n";
return true;
}
set_error_handler( 'errorHandler1' );
set_error_handler( 'errorHandler2' );
trigger_error( 'Foo', E_USER_WARNING );
?>
==END==
--EXPECT--
Caught on second level: 'Foo'
Caught on second level: 'Foo'
==END==