1--TEST-- 2Bug #40915 (addcslashes unexpected behavior with binary input) 3--FILE-- 4<?php 5 6$str = (binary)"a\000z"; 7 8var_dump(addslashes($str)); 9var_dump(addcslashes($str, (binary)"")); 10var_dump(addcslashes($str, (binary)"\000z")); 11var_dump(addcslashes( $str, (binary)"z")); 12 13echo "Done\n"; 14?> 15--EXPECT-- 16string(4) "a\0z" 17string(3) "az" 18string(7) "a\000\z" 19string(4) "a\z" 20Done 21