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

TODO: Anchors as “Real” References #1

Closed
taufik-nurrohman opened this issue Oct 1, 2023 · 1 comment
Closed

TODO: Anchors as “Real” References #1

taufik-nurrohman opened this issue Oct 1, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@taufik-nurrohman
Copy link
Owner

Currently:

$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

echo json_encode($value); // Returns `{"asdf-1":1,"asdf-2":1,"asdf-3":1}`
$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

$lot['&asdf'] = 111;

echo json_encode($value); // Returns `{"asdf-1":1,"asdf-2":1,"asdf-3":1}`
$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

$value->{'asdf-1'} = 111;

echo json_encode($value); // Returns `{"asdf-1":111,"asdf-2":1,"asdf-3":1}`
$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

$value->{'asdf-2'} = 111;

echo json_encode($value); // Returns `{"asdf-1":1,"asdf-2":111,"asdf-3":1}`

Expected:

$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

$lot['&asdf'] = 111;

echo json_encode($value); // Returns `{"asdf-1":111,"asdf-2":111,"asdf-3":111}`
$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

$value->{'asdf-1'} = 111;

echo json_encode($value); // Returns `{"asdf-1":111,"asdf-2":111,"asdf-3":111}`
$lot = [];
$value = from_yaml(<<<YAML
asdf-1: &asdf 1
asdf-2: *asdf
asdf-3: *asdf
YAML, false, $lot);

$value->{'asdf-2'} = 111;

echo json_encode($value); // Returns `{"asdf-1":111,"asdf-2":111,"asdf-3":111}`
@taufik-nurrohman taufik-nurrohman added the help wanted Extra attention is needed label Oct 1, 2023
@taufik-nurrohman
Copy link
Owner Author

taufik-nurrohman commented Feb 22, 2024

Um, it is probably too overkill for this project 😕

@taufik-nurrohman taufik-nurrohman closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant