Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use classes for PHP kata #147

Closed
matks opened this issue Sep 27, 2021 · 3 comments
Closed

Cannot use classes for PHP kata #147

matks opened this issue Sep 27, 2021 · 3 comments
Labels
bug Something isn't working language/php

Comments

@matks
Copy link

matks commented Sep 27, 2021

Describe the bug
It seems that when I use PHP classes for kata I get an error. As soon as there is a PHP class in the solution, it fails.

To Reproduce
If I input the following empty PHP code for kata
Conway's Game of Life - Unlimited Edition
:

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 {}

I re-run tests, I get a Error : Call to undefined function get_generation()

I can see this issue on another PHP kata.

Expected behavior
PHP Classes should be usable in a PHP kata.

Screenshots
See this recording of my browser https://watch.screencastify.com/v/Ud5L3dxTj3UOK8LLlzIv

Browser
Chrome, however issue was reproduced by another user and code is executed server-side. So I don't think browser informations are useful.

  • OS: Mac OS X 11.5.2
  • Browser: Chrome
  • Version 93

Additional context
I wrote about this in discussion https://www.codewars.com/kata/52423db9add6f6fc39000354/discuss?#614ce089a155110033bb874b

@error256
Copy link

It looks like it messes up test class name detection or something. Even a comment like // class A causes this. It happens it 8.0 and 7.4, but not in 7.0.

@kazk kazk transferred this issue from codewars/codewars.com Sep 27, 2021
@kazk kazk added language/php bug Something isn't working labels Sep 27, 2021
@kazk
Copy link
Member

kazk commented Sep 28, 2021

Deployed the fix. Thanks for reporting.

@kazk kazk closed this as completed Sep 28, 2021
@matks
Copy link
Author

matks commented Sep 28, 2021

Thanks for the quick fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language/php
Projects
None yet
Development

No branches or pull requests

3 participants