forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
045.phpt
46 lines (42 loc) · 1.06 KB
/
045.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--TEST--
Check for segfault while use closure as error handler
--SKIPIF--
<?php
if (!extension_loaded("yaf")) print "skip";
if (!version_compare(PHP_VERSION, "5.3", "ge")) print "skip only for 5.3+";
?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
"application" => array(
"directory" => realpath(dirname(__FILE__)),
"dispatcher" => array(
"catchException" => 0,
"throwException" => 0,
),
),
);
class Bootstrap extends Yaf_Bootstrap_Abstract {
protected function _initErrorHandler(Yaf_Dispatcher $dispatcher) {
$dispatcher->setErrorHandler(function($errorCode, $errorMessage, $file, $line) {
throw new ErrorException($errorMessage, 0, $errorCode, $file, $line);
});
}
}
class IndexController extends Yaf_Controller_Abstract {
public function indexAction() {
echo $undefined_var;
return FALSE;
}
}
$app = new Yaf_Application($config);
try {
$app->bootstrap()->run();
} catch (Exception $e) {
var_dump($e->getMessage());
}
?>
--EXPECTF--
string(33) "Undefined variable: undefined_var"