Ad
  • Custom User Avatar

    Thanks for the heads-up! You’re right that under this kata’s rules (ASCII letters only, case-insensitive, empty → false), “xgx” is a palindrome.

    I’ve:

    • Clarified the description to state that single-letter results do count as palindromes.
    • Updated the tests: the case for "xgx" now expects true, added a contrasting "xgy" => false, and expanded samples/hidden tests accordingly.

    Please give it another try with the updated tests. If anything still looks off, ping me and I’ll adjust fast.

  • Custom User Avatar

    thank you for your response! i will work a little bit more on that kata :) i hope you enjoyed it anyway

  • Custom User Avatar

    Notes

    • PHP-only series; behavior defined for PHP runners.
    • No $default parameter; invalid inputs return 0.
    • Signature included and fixed: function toIntSafe($v): int.
    • Rules explained in words; regex not required to read the spec.
    • Leading zeros clarified ("010" → 10).
    • Initial solution is not empty (compiles, returns 0 until implemented).
  • Custom User Avatar
    Should NOT be palindrome: xgx
    Failed asserting that true is false.
    

    xgx is a palindrome

  • Custom User Avatar

    thank you for your response! i will work a little bit more on that kata :) i hope you enjoyed it anyway

  • Custom User Avatar
    • Initial solution setup should not be empty

    • Why is 010 interpreted as 0 (Default value?) It matches the given regex , which should output 10, since 00 also outputs 0 in your sample tests

    • Also, please do not use $default , and include the function signature , and a lot of PHP constants in the description (unless you've planned to make this a PHP only series? -> Then you should probably specify it clearly at the beginning)

    • I don't like the fact that the regex for valid string is given directly, instead you should explain it in actual wording

    • The following should be explained clearer with relevant examples (1e8, 0b0, 0x0 ...)

      no scientific notation, no base prefixes.

    • Random tests could use some shuffling and more randomness (for the case of strings, true, false, null)