$ php xmlillegalchars.php Strtok == Strtok == - Testing "Hello": 0.206 seconds - Testing "Hello\000": 0.206 seconds - Testing "A longer string that does not contain illegal characters": 0.228 seconds - Testing "A longer string that contains illegal characters at the end (\001)": 0.228 seconds - Testing "Medium-size with BEL (\a) in the middle of it": 0.212 seconds - Testing "\001At the beginning": 0.208 seconds - Testing "Multi\r\nline": 0.215 seconds * Total time: 1.503 seconds $ php xmlillegalchars.php Strcspn == Strcspn == - Testing "Hello": 0.186 seconds - Testing "Hello\000": 0.188 seconds - Testing "A longer string that does not contain illegal characters": 0.193 seconds - Testing "A longer string that contains illegal characters at the end (\001)": 0.182 seconds - Testing "Medium-size with BEL (\a) in the middle of it": 0.180 seconds - Testing "\001At the beginning": 0.177 seconds - Testing "Multi\r\nline": 0.192 seconds * Total time: 1.297 seconds $ php xmlillegalchars.php Strspn == Strspn == - Testing "Hello": 0.190 seconds - Testing "Hello\000": 0.183 seconds - Testing "A longer string that does not contain illegal characters": 0.193 seconds - Testing "A longer string that contains illegal characters at the end (\001)": 0.196 seconds - Testing "Medium-size with BEL (\a) in the middle of it": 0.188 seconds - Testing "\001At the beginning": 0.182 seconds - Testing "Multi\r\nline": 0.189 seconds * Total time: 1.321 seconds $ php xmlillegalchars.php Regex == Regex == - Testing "Hello": 0.253 seconds - Testing "Hello\000": 0.335 seconds - Testing "A longer string that does not contain illegal characters": 0.429 seconds - Testing "A longer string that contains illegal characters at the end (\001)": 0.535 seconds - Testing "Medium-size with BEL (\a) in the middle of it": 0.392 seconds - Testing "\001At the beginning": 0.320 seconds - Testing "Multi\r\nline": 0.281 seconds * Total time: 2.546 seconds