-
-
Save jeff/6ab1d188db2cd21ac1d45cf06544d7d2 to your computer and use it in GitHub Desktop.
changes in JSON::XS quoting of scalar(@emptyarray)
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
perl-5.32.1 | |
========== | |
Perl 5.032001 | |
JSON::XS 4.03 | |
Dumping $resp: | |
SV = IV(0x5639baf18fe8) at 0x5639baf18ff8 | |
REFCNT = 1 | |
FLAGS = (ROK) | |
RV = 0x5639baeb2358 | |
SV = PVHV(0x5639baeb7b70) at 0x5639baeb2358 | |
REFCNT = 1 | |
FLAGS = (SHAREKEYS) | |
ARRAY = 0x5639baf349b0 (0:7, 1:1) | |
hash quality = 100.0% | |
KEYS = 1 | |
FILL = 1 | |
MAX = 7 | |
Elt "foo" HASH = 0x6263db87 | |
SV = PVNV(0x5639baeb10f0) at 0x5639baeb2610 | |
REFCNT = 1 | |
FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK) | |
IV = 0 | |
NV = 0 | |
PV = 0x5639baf5ebc0 "0"\0 | |
CUR = 1 | |
LEN = 10 | |
{"foo":"0"} | |
perl-5.28.3 | |
========== | |
Perl 5.028003 | |
JSON::XS 4.03 | |
Dumping $resp: | |
SV = IV(0x55618f406f48) at 0x55618f406f58 | |
REFCNT = 1 | |
FLAGS = (ROK) | |
RV = 0x55618f3ac328 | |
SV = PVHV(0x55618f3b2770) at 0x55618f3ac328 | |
REFCNT = 1 | |
FLAGS = (SHAREKEYS) | |
ARRAY = 0x55618f42b590 (0:7, 1:1) | |
hash quality = 100.0% | |
KEYS = 1 | |
FILL = 1 | |
MAX = 7 | |
Elt "foo" HASH = 0xf5030846 | |
SV = PVNV(0x55618f3ab0f0) at 0x55618f3c6020 | |
REFCNT = 1 | |
FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK) | |
IV = 0 | |
NV = 0 | |
PV = 0x55618f45b800 "0"\0 | |
CUR = 1 | |
LEN = 10 | |
{"foo":"0"} | |
perl-5.26.3 | |
========== | |
Perl 5.026003 | |
JSON::XS 4.03 | |
Dumping $resp: | |
SV = IV(0x5587840c26b8) at 0x5587840c26c8 | |
REFCNT = 1 | |
FLAGS = (ROK) | |
RV = 0x558784080328 | |
SV = PVHV(0x558784086d60) at 0x558784080328 | |
REFCNT = 1 | |
FLAGS = (SHAREKEYS) | |
ARRAY = 0x5587840b70c0 (0:7, 1:1) | |
hash quality = 100.0% | |
KEYS = 1 | |
FILL = 1 | |
MAX = 7 | |
Elt "foo" HASH = 0x61886f7a | |
SV = IV(0x5587840944e0) at 0x5587840944f0 | |
REFCNT = 1 | |
FLAGS = (IOK,pIOK) | |
IV = 0 | |
{"foo":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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Devel::Peek; | |
use JSON::XS; | |
print "Perl $]\n"; | |
print "JSON::XS $JSON::XS::VERSION\n"; | |
my @bar = (); | |
my $resp = { | |
foo => scalar(@bar) | |
}; | |
warn "Dumping \$resp:\n"; | |
Dump($resp); | |
print encode_json($resp), "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment