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