Last active
August 29, 2015 14:04
-
-
Save dergachev/c2b3c18d65edf00aa8fd to your computer and use it in GitHub Desktop.
Gist for spyc php bug: https://github.com/mustangostang/spyc/issues/35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==================== | |
Test name: test with tilde, should print NULL | |
==================== | |
INPUT: | |
--- | |
1: a | |
2: ~ | |
RESULT: | |
array(2) { | |
[1]=> | |
string(1) "a" | |
[2]=> | |
NULL | |
} | |
==================== | |
Test name: test with empty map value, should print NULL, prints empty string | |
==================== | |
INPUT: | |
--- | |
1: a | |
2: | |
RESULT: | |
array(2) { | |
[1]=> | |
string(1) "a" | |
[2]=> | |
string(0) "" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# see http://stackoverflow.com/questions/833927/yaml-dictionary-with-empty-value | |
include "Spyc.php"; | |
test_spyc("test with tilde, should print NULL", "--- | |
1: a | |
2: ~"); | |
test_spyc("test with empty map value, should print NULL, prints empty string", "--- | |
1: a | |
2: "); | |
function test_spyc($test_name, $input) { | |
print "\n====================\nTest name: $test_name\n====================\n\n"; | |
print "INPUT:\n\n$input\n\n"; | |
$arr = spyc_load($input); | |
print "RESULT:\n\n"; | |
var_dump($arr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment