mirror of
https://github.com/php/php-src.git
synced 2026-04-30 03:33:17 +02:00
ca49a7bec2
RFC: https://wiki.php.net/rfc/clone_with_v2 Co-authored-by: Volker Dusch <volker@tideways-gmbh.com>
16 lines
311 B
PHP
16 lines
311 B
PHP
--TEST--
|
|
Using clone statement on undefined variable
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
$a = clone $b;
|
|
} catch (Error $e) {
|
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Undefined variable $b in %s on line %d
|
|
TypeError: clone(): Argument #1 ($object) must be of type object, null given
|