diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-03-09 13:57:15 +0100 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-03-09 14:01:32 +0100 |
commit | 1c94ff0595bbe6f3df8058aff7252bda09dc4a15 (patch) | |
tree | efe488bc3292d544657fca92c4347c9b872931eb /Zend/tests/bug48693.phpt | |
parent | 2f156c61f19a889c8ed39fe8eb3b3220555db647 (diff) | |
download | php-git-1c94ff0595bbe6f3df8058aff7252bda09dc4a15.tar.gz |
Implement engine exceptions
RFC: https://wiki.php.net/rfc/engine_exceptions_for_php7
Pending changes regarding naming of BaseException and whether it
should be an interface.
Diffstat (limited to 'Zend/tests/bug48693.phpt')
-rw-r--r-- | Zend/tests/bug48693.phpt | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/Zend/tests/bug48693.phpt b/Zend/tests/bug48693.phpt index e5f7ce8f45..d2baf2a695 100644 --- a/Zend/tests/bug48693.phpt +++ b/Zend/tests/bug48693.phpt @@ -3,26 +3,43 @@ Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted) --FILE-- <?php -$x = create_function('', 'return 1; }'); -$y = create_function('', 'function a() { }; return 2;'); -$z = create_function('', '{'); -$w = create_function('', 'return 3;'); +try { + $x = create_function('', 'return 1; }'); +} catch (ParseException $e) { + echo "$e\n\n"; +} +try { + $y = create_function('', 'function a() { }; return 2;'); +} catch (ParseException $e) { + echo "$e\n\n"; +} +try { + $z = create_function('', '{'); +} catch (ParseException $e) { + echo "$e\n\n"; +} +try { + $w = create_function('', 'return 3;'); +} catch (ParseException $e) { + echo "$e\n\n"; +} var_dump( - $x, $y(), - $z, - $w(), - $y != $z + $w() ); ?> --EXPECTF-- -Parse error: %s in %s(%d) : runtime-created function on line 1 +exception 'ParseException' with message 'syntax error, unexpected '}', expecting end of file' in %sbug48693.php(4) : runtime-created function:1 +Stack trace: +#0 %sbug48693.php(4): create_function('', 'return 1; }') +#1 {main} + +exception 'ParseException' with message 'syntax error, unexpected end of file' in %sbug48693.php(14) : runtime-created function:1 +Stack trace: +#0 %sbug48693.php(14): create_function('', '{') +#1 {main} -Parse error: %s %s(%d) : runtime-created function on line 1 -bool(false) int(2) -bool(false) int(3) -bool(true) |