-
Notifications
You must be signed in to change notification settings - Fork 29
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
fixed a bug when used the function "in_array" #25
Conversation
Could you describe your use-case with an Toml example? |
Please see my new PR.
The output:
|
…he PR #25 has been solved. The test file `TomlBuilderTest` has been refactored for readability
I just resolved your issue. The problem was I was looking for a key in the array values. I just committed that change. In a few days, I'll do a release. |
Thank you for this PR. It'll be fixed in v1.0.4 |
I used your code to convert a PHP array to a
.toml
file, but when I usedTomlBuilder
class to build my.toml
file, the program always threw theDumpException
.When my array included the zero element, your expression return
true
, made program stop.I debugged it and found this bug.document of in_array
I added the third param
true
in your code, I guessed it would always suit for your scene.In that case, I could build my program easily.
Additionally, there were some mistakes in the code. For example, the variable
$this->keyListArryOfTables
was akey=>value
array, so I thoughtarray_key_exists
would be more correct thanin_array
.