Ad
  • Custom User Avatar
  • Custom User Avatar

    I really confirm the issue on my side.

    If I input the following empty code:

    function get_generation(array $cells, int $generations): array {
      return [[]]; 
    }
    

    I run tests, I get, as expected, a PHPUnit error message 'Failed asserting that two arrays are equal.' because my code does not pass the tests.

    Now I add an empty class below

    function get_generation(array $cells, int $generations): array {
      return [[]]; 
    }
    
    class A {}
    

    Hop, re-run tests: Error : Call to undefined function get_generation()

    I tried with another kata, same. No idea what is wrong with my setup. I tried another kata, same. See this recording of my browser https://watch.screencastify.com/v/Ud5L3dxTj3UOK8LLlzIv

  • Custom User Avatar

    I am sorry but what you just said does not work for me. I copy-paste your example and it does not work. Same error when running tests: Error : Call to undefined function get_generation()

    I have this global get_generation() function next my classes, and yet I get the error. As soon as I remove the classes, the function is found again. Can you verify, so I know if it is just me or a confirmed issue ?

  • Custom User Avatar

    Oh :( disappointed. I built a solution in PHP but I use classes, a class Cell and a class Grid.

    When I use classes and I run tests, output is
    Error : Call to undefined function get_generation()

    With no classes it runs fine. So... classes are not supported by codewars PHP ?