1--TEST-- 2Crypto\Cipher::__clone basic usage. 3--FILE-- 4<?php 5$key = str_repeat('x', 32); 6$iv = str_repeat('i', 16); 7$data1 = str_repeat('a', 16); 8$data2 = str_repeat('b', 16); 9 10// basic creation 11$cipher = new Crypto\Cipher('aes-256-cbc'); 12$cipher->encryptInit($key, $iv); 13$cipher->encryptUpdate($data1); 14$cipher_clone = clone $cipher; 15echo $cipher_clone->getAlgorithmName() . "\n"; 16 17$cipher->encryptUpdate($data2); 18echo bin2hex($cipher->encryptFinish()) . "\n"; 19 20$cipher_clone->encryptUpdate($data2); 21echo bin2hex($cipher_clone->encryptFinish()) . "\n"; 22 23echo "SUCCESS\n"; 24?> 25--EXPECT-- 26AES-256-CBC 27247d77ff0e6a8b2852f3d12072cab915 28247d77ff0e6a8b2852f3d12072cab915 29SUCCESS 30 31 32