Ad
  • Custom User Avatar
    • fixed the order of expected and actual

    • fixed by upgrading to PHP 8.0

      • root cause of the issue: the reference solution used usort

      the manual says:

      If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined.

  • Custom User Avatar

    language PHP 7.0

    $this->assertEquals(last($string), $answer);
    
    • expected and actual mixed up positions.

    • If two words have the same last letter, they returned array should show them in the order they appeared in the given string.
      thats wrong to!

    Input string:
    uvrov kltfopf erzf ixdm
    
    Failed asserting that two arrays are equal.
    Actual: Array (
        0 => 'kltfopf'
        1 => 'erzf'
        2 => 'ixdm'
        3 => 'uvrov'
    )
    Expected: Array (
        0 => 'erzf'
        1 => 'kltfopf'
        2 => 'ixdm'
        3 => 'uvrov'
    )