Skip to content

Adds tests for uncloneable Error and Exception classes #6388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Zend/tests/error_clone.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
Errors cannot be cloned
--FILE--
<?php
$error = new Error();
$newError = clone $error;
?>
--EXPECTF--
Fatal error: Uncaught Error: Trying to clone an uncloneable object of class Error in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
12 changes: 12 additions & 0 deletions Zend/tests/exception_clone.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
Exceptions cannot be cloned
--FILE--
<?php
$exception = new Exception();
$newException = clone $exception;
?>
--EXPECTF--
Fatal error: Uncaught Error: Trying to clone an uncloneable object of class Exception in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d