xref: /PHP-7.0/Zend/tests/bug74408.phpt (revision eb03f164)
1--TEST--
2Bug #74408 (Endless loop bypassing execution time limit)
3--INI--
4error_reporting = E_ALL | E_DEPRECATED | E_STRICT
5--FILE--
6<?php
7
8 //php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
9
10 class ErrorHandling {
11
12  public  function error_handler($errno, $errstr, $errfile, $errline) {
13	  $bla = new NonExistingClass2();
14  }
15
16  public function exception_handler(Error $e) {
17	  echo "Caught, exception: " . $e->getMessage();
18  }
19 }
20
21 set_error_handler('ErrorHandling::error_handler');
22 set_exception_handler('ErrorHandling::exception_handler');
23
24 $blubb = new NonExistingClass();
25?>
26--EXPECTF--
27Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
28
29Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
30
31Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
32
33Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
34Stack trace:
35#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
36#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
37#2 {main}
38  thrown in %sbug74408.php on line %d
39