Skip to content

Commit

Permalink
Update example to output a single line on PHP 7.2
Browse files Browse the repository at this point in the history
Somewhere in the development leading up to PHP 7.2, var_dump()
started outputting the file and line number as part of it's output.
This causes one of the end-to-end tests to fail as the example script
it uses outputs twice as many lines as expected.

This fixes this by using var_export() and a little wrapping to output
useful debug data if something goes wrong and sensible output
otherwise.
  • Loading branch information
SkUrRiEr committed Jun 4, 2018
1 parent d7cbea4 commit 4ebc114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/generating_integers.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
$eris
->forAll(Generator\int())
->then(function ($integer) {
var_dump($integer);
echo var_export($integer, true) . PHP_EOL;
});

0 comments on commit 4ebc114

Please sign in to comment.