Repository navigation
Conversation
Member
|
This PR contains unrelated commits. Also I think the problem can be much easier be solved with a userland function instead of adding yet another constant. |
Contributor
Author
|
@dsp I had an earlier commit on my master branch that I had already pushed, so I did a local revert on them. I haven't figured out how to get rid of them altogether. What would you suggest as a userland function, though? |
Contributor
Author
|
Damn, I think I forked up my forked repo =( |
heyJordanParker
added a commit
to heyJordanParker/php-sharp
that referenced
this pull request
Oct 13, 2026
Problem sharp/baseline/spec lists the spec examples Guard 1 expects to fail. After the merge of php-sharp master and of mago-sharp feat/slice-structs into sharp/mago, 23 of them pass, and sharp/bin/spec fails while a passing example stays listed. Solution sharp/bin/spec, run with the engine and the mago built from this tree, printed these removals, and a second run passes against the new baseline. Section 10 removes struct-changes. struct-parse stays until generics R3c's Sharp\Internal\accepts lands, and struct-parse-object until the Object type of task php#454 lands. sharp/baseline/spec/ ├── §2/keyword-members, §2/keyword-names removed ├── §5/interface-members removed ├── §9.1/constructor-call-this, named-constructors, set-once, super-call removed ├── §10/struct-changes removed ├── §12/collection-read-methods, collection-write-methods, enum-map-keys, │ index-changes, natural-remove, nullable-map-values removed ├── §15/emit-forms, extern-event, extern-event-effects, listener-errors, │ standalone-event removed ├── §16/initializer-shorthand removed ├── §17/braces removed ├── §23/import-rename removed └── §28/module-law removed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JSON_FORCE_OBJECT option always encodes arrays as JSON objects, but there are cases in which you know the array will have only associate keys at a later stage.
I've created the JSON_FORCE_EMPTY_OBJECT to encode only empty arrays as objects. Numerically indexed arrays retain their regular [] encoding.
A specific use-case is when the encoded value is passed to JavaScript; if an array is passed, you can add properties to it, but when you later do
JSON.stringify()it returns an empty array. This is quite unlike PHP of course, because arrays can be both things, depending on whether it contains only numeric keys or not.