Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
this kata is not avalaible in newer PHP language versions (
7.4
,8.0
) because the user's solution and the tests are no longer concatenated into a single file in those versions, making the tests unable to find the variables$hello_world
and$person_description
.Adding
require '_solution.php';
at the top level scope in the test suite fixes the issue.I think the text in this paragraph is incorrect if not quite misleading. Closures are a specific subset of anonymous functions, not every anonymous functions forms a closure.
"An anonymous function is basically an unnamed function (aka closure)"
First of all, what's a closure?
A closure is the combination of a function and its lexical scope. In layman terms a closure can access variables in its lexical scope even after the scope has exited.
In JavaScript the capture of outer variables is automatic, a JS function can always access variables in its outer scope. In PHP it cannot, you need to explicitly use the
use
keyword.There's also other differences in syntax and mutability, but that's irrelevant.
In PHP, a closure is thus a type of anonymous function that captures variables from the surrounding scope via
use
.Thus, closures are a subset of anonymous function, they are absolutely not synonyms.
now on dart
Translation Dart
New and improved Groovy translation
It would be nice to have actual lengths shown to you when you test the solution. How am I gonna brag about my code being (possibly) the shortest?
This comment is hidden because it contains spoiler information about the solution
JS version is outdated (8.1.3, while the current one is 18), but if you try to upgrade it via
expect
/assert
, the inner restriction forObject.prototype.toString
is aborting any of assertions in case if the test is failing.Seems like either this kata is probably impossible to properly upgrade, or it possible but with lots of weird maneurs, but still raising the issue unless there is a way to upgrade the kata or something like that
JS fork 🤖
mocha/chai
assertions +lodash
for randomnessDescription should be language-agnostic
Python default argument name shadows builtin.
Lua fork
it
s without meaningful titleThank you for the great work of this series, kindly correct the link in the description to this https://github.com/sebastianbergmann/phpunit/blob/9f2ebaf18f7741a5ee587f80a42632edaa42d424/src/Framework/TestCase.php#L4
Can be found exactly here:
Enable Coq version 8.15
Permit Coq Version 8.15
This comment is hidden because it contains spoiler information about the solution
Loading more items...