. Fixed bug #78510 (Partially uninitialized buffer returned by
sodium_crypto_generichash_init()). (Frank Denis, cmb)
+- SPL:
+ . Fixed bug #72884 (SplObject isCloneable() returns true but errs on clone).
+ (Chu Zhaowei)
+
29 Aug 2019, PHP 7.2.22
- Core:
intern->u.dir.index = index;
break;
case SPL_FS_FILE:
- zend_throw_error(NULL, "An object of class %s cannot be cloned", ZSTR_VAL(old_object->ce->name));
- return new_object;
+ ZEND_ASSERT(0);
}
intern->file_class = source->file_class;
REGISTER_SPL_IMPLEMENTS(RecursiveDirectoryIterator, RecursiveIterator);
memcpy(&spl_filesystem_object_check_handlers, &spl_filesystem_object_handlers, sizeof(zend_object_handlers));
+ spl_filesystem_object_check_handlers.clone_obj = NULL;
spl_filesystem_object_check_handlers.get_method = spl_filesystem_object_get_method_check;
#ifdef HAVE_GLOB
--- /dev/null
+--TEST--
+Bug #72884: isCloneable() on SplFileObject should return false
+--FILE--
+<?php
+$x=new SplFileObject(__FILE__);
+$r=new ReflectionObject($x);
+var_dump($r->isCloneable());
+
+--EXPECT--
+bool(false)
var_dump($y);
?>
--EXPECTF--
-string(49) "An object of class SplFileObject cannot be cloned"
+string(60) "Trying to clone an uncloneable object of class SplFileObject"
Notice: Undefined variable: y in %sbug72888.php on line %d
NULL