With compression the `Redis::SERIALIZER_JSON` serializer is not working
Author: cetverCreated Jun 8, 2023Updated May 1, 2026
Labelsbug
Expected behaviour
With compression the Redis::SERIALIZER_JSON serializer will transform string to array
Actual behaviour
For some JSON values there is no deserialization
I'm seeing this behaviour on
- OS:
Ubuntu 20.04.5 LTS - Redis:
redis_version:6.2.7 - PHP:
PHP 8.1.11 (cli) (built: Sep 29 2022 22:28:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.11, Copyright (c) Zend Technologies
with Zend OPcache v8.1.11, Copyright (c), by Zend Technologies
with Xdebug v3.1.4, Copyright (c) 2002-2022, by Derick Rethans- phpredis:
Redis Support => enabled
Redis Version => 5.3.7
Redis Sentinel Version => 0.1
Available serializers => php, json, igbinary
Available compression => lzf, zstd, lz4
Directive => Local Value => Master Value
redis.arrays.algorithm => no value => no value
redis.arrays.auth => no value => no value
redis.arrays.autorehash => 0 => 0
redis.arrays.connecttimeout => 0 => 0
redis.arrays.consistent => 0 => 0
redis.arrays.distributor => no value => no value
redis.arrays.functions => no value => no value
redis.arrays.hosts => no value => no value
redis.arrays.index => 0 => 0
redis.arrays.lazyconnect => 0 => 0
redis.arrays.names => no value => no value
redis.arrays.pconnect => 0 => 0
redis.arrays.previous => no value => no value
redis.arrays.readtimeout => 0 => 0
redis.arrays.retryinterval => 0 => 0
redis.clusters.auth => no value => no value
redis.clusters.cache_slots => 0 => 0
redis.clusters.persistent => 0 => 0
redis.clusters.read_timeout => 0 => 0
redis.clusters.seeds => no value => no value
redis.clusters.timeout => 0 => 0
redis.pconnect.connection_limit => 0 => 0
redis.pconnect.echo_check_liveness => 1 => 1
redis.pconnect.pool_detect_dirty => 0 => 0
redis.pconnect.pool_pattern => no value => no value
redis.pconnect.pool_poll_timeout => 0 => 0
redis.pconnect.pooling_enabled => 1 => 1
redis.session.lock_expire => 0 => 0
redis.session.lock_retries => 10 => 10
redis.session.lock_wait_time => 2000 => 2000
redis.session.locking_enabled => 0 => 0Steps to reproduce, backtrace or example script
$key = 'q';
$items = [
json_decode(
'{"1483228800000":0,"1483315200000":0,"1483401600000":0,"1483488000000":0,"1483574400000":0,"1483660800000":0,"1483747200000":0,"1483833600000":0,"1483920000000":0,"1484006400000":0,"1484092800000":0,"1484179200000":0,"1484265600000":0,"1484352000000":0,"1484438400000":0,"1484524800000":0,"1484611200000":0,"1484697600000":0,"1484784000000":0,"1484870400000":0,"1484956800000":0,"1485043200000":0,"1485129600000":0,"1485216000000":0,"1485302400000":0,"1485388800000":0,"1485475200000":0,"1485561600000":0,"1485648000000":0,"1485734400000":0,"1485820800000":0,"1485907200000":0,"1485993600000":0,"1486080000000":0,"1486166400000":0,"1486252800000":0,"1486339200000":0,"1486425600000":0,"1486512000000":0,"1486598400000":0,"1486684800000":0,"1486771200000":0,"1486857600000":0,"1486944000000":0,"1487030400000":0,"1487116800000":0,"1487203200000":0,"1487289600000":0,"1487376000000":0,"1487462400000":0,"1487548800000":0,"1487635200000":0,"1487721600000":0,"1487808000000":0,"1487894400000":0,"1487980800000":0,"1488067200000":0,"1488153600000":0,"1488240000000":0,"1488326400000":0,"1488412800000":0,"1488499200000":0,"1488585600000":0,"1488672000000":0,"1488758400000":0,"1488844800000":0,"1488931200000":0,"1489017600000":0,"1489104000000":0,"1489190400000":0,"1489276800000":0,"1489363200000":0,"1489449600000":0,"1489536000000":0,"1489622400000":0,"1489708800000":0,"1489795200000":0,"1489881600000":0,"1489968000000":0,"1490054400000":0,"1490140800000":0,"1490227200000":0,"1490313600000":0,"1490400000000":0,"1490486400000":0,"1490572800000":0,"1490659200000":0,"1490745600000":0,"1490832000000":0,"1490918400000":0,"1491004800000":0,"1491091200000":0,"1491177600000":0,"1491264000000":0,"1491350400000":0,"1491436800000":0,"1491523200000":0,"1491609600000":0,"1491696000000":0,"1491782400000":0,"1491868800000":0,"1491955200000":0,"1492041600000":0,"1492128000000":0,"1492214400000":0,"1492300800000":0,"1492387200000":0,"1492473600000":0,"1492560000000":0,"1492646400000":0,"1492732800000":0,"1492819200000":0,"1492905600000":0,"1492992000000":0,"1493078400000":0,"1493164800000":0,"1493251200000":0,"1493337600000":0,"1493424000000":0,"1493510400000":0,"1493596800000":0,"1493683200000":0,"1493769600000":0,"1493856000000":0,"1493942400000":0,"1494028800000":0,"1494115200000":0,"1494201600000":0,"1494288000000":0,"1494374400000":0,"1494460800000":0,"1494547200000":0,"1494633600000":0,"1494720000000":0,"1494806400000":0,"1494892800000":0,"1494979200000":0,"1495065600000":0,"1495152000000":0,"1495238400000":0,"1495324800000":0,"1495411200000":0,"1495497600000":0,"1495584000000":0,"1495670400000":0,"1495756800000":0,"1495843200000":0,"1495929600000":0,"1496016000000":0,"1496102400000":0,"1496188800000":0,"1496275200000":0,"1496361600000":0,"1496448000000":0,"1496534400000":0,"1496620800000":0,"1496707200000":0,"1496793600000":0,"1496880000000":0,"1496966400000":0,"1497052800000":0,"1497139200000":0,"1497225600000":0,"1497312000000":0,"1497398400000":0,"1497484800000":0,"1497571200000":0,"1497657600000":0,"1497744000000":0,"1497830400000":0,"1497916800000":0,"1498003200000":0,"1498089600000":0,"1498176000000":0,"1498262400000":0,"1498348800000":0,"1498435200000":0,"1498521600000":0,"1498608000000":0,"1498694400000":0,"1498780800000":0,"1498867200000":0,"1498953600000":0,"1499040000000":0,"1499126400000":0,"1499212800000":0,"1499299200000":0,"1499385600000":0,"1499472000000":0,"1499558400000":0,"1499644800000":0,"1499731200000":0,"1499817600000":0,"1499904000000":0,"1499990400000":0,"1500076800000":0,"1500163200000":0,"1500249600000":0,"1500336000000":0,"1500422400000":0,"1500508800000":0,"1500595200000":0,"1500681600000":0,"1500768000000":0,"1500854400000":0,"1500940800000":0,"1501027200000":0,"1501113600000":0,"1501200000000":0,"1501286400000":0,"1501372800000":0,"1501459200000":0,"1501545600000":0,"1501632000000":0,"1501718400000":0,"1501804800000":0,"1501891200000":0,"1501977600000":0,"1502064000000":0,"1502150400000":0,"1502236800000":0,"1502323200000":0,"1502409600000":0,"1502496000000":0,"1502582400000":0,"1502668800000":0,"1502755200000":0,"1502841600000":0,"1502928000000":0,"1503014400000":0,"1503100800000":0,"1503187200000":0,"1503273600000":0,"1503360000000":0,"1503446400000":0,"1503532800000":0,"1503619200000":0,"1503705600000":0,"1503792000000":0,"1503878400000":0,"1503964800000":0,"1504051200000":0,"1504137600000":0,"1504224000000":0,"1504310400000":0,"1504396800000":0,"1504483200000":0,"1504569600000":0,"1504656000000":0,"1504742400000":0,"1504828800000":0,"1504915200000":0,"1505001600000":0,"1505088000000":0,"1505174400000":0,"1505260800000":0,"1505347200000":0,"1505433600000":0,"1505520000000":0,"1505606400000":0,"1505692800000":0,"1505779200000":0,"1505865600000":0,"1505952000000":0,"1506038400000":0,"1506124800000":0,"1506211200000":0,"1506297600000":0,"1506384000000":0,"1506470400000":0,"1506556800000":0,"1506643200000":0,"1506729600000":0,"1506816000000":0,"1506902400000":0,"1506988800000":0,"1507075200000":0,"1507161600000":0,"1507248000000":0,"1507334400000":0,"1507420800000":0,"1507507200000":0,"1507593600000":0,"1507680000000":0,"1507766400000":0,"1507852800000":0,"1507939200000":0,"1508025600000":0,"1508112000000":0,"1508198400000":0,"1508284800000":0,"1508371200000":0,"1508457600000":0,"1508544000000":0,"1508630400000":0,"1508716800000":0,"1508803200000":0,"1508889600000":0,"1508976000000":0,"1509062400000":0,"1509148800000":0,"1509235200000":0,"1509321600000":0,"1509408000000":0,"1509494400000":0,"1509580800000":0,"1509667200000":0,"1509753600000":0,"1509840000000":0,"1509926400000":0,"1510012800000":0,"1510099200000":0,"1510185600000":0,"1510272000000":0,"1510358400000":0,"1510444800000":0,"1510531200000":0,"1510617600000":0,"1510704000000":0,"1510790400000":0,"1510876800000":0,"1510963200000":0,"1511049600000":0,"1511136000000":0,"1511222400000":0,"1511308800000":0,"1511395200000":0,"1511481600000":0,"1511568000000":0,"1511654400000":0,"1511740800000":0,"1511827200000":0,"1511913600000":0,"1512000000000":0,"1512086400000":0,"1512172800000":0,"1512259200000":0,"1512345600000":0,"1512432000000":0,"1512518400000":0,"1512604800000":0,"1512691200000":0,"1512777600000":0,"1512864000000":0,"1512950400000":0,"1513036800000":0,"1513123200000":0,"1513209600000":0,"1513296000000":0,"1513382400000":0,"1513468800000":0,"1513555200000":0,"1513641600000":0,"1513728000000":0,"1513814400000":0,"1513900800000":0,"1513987200000":0,"1514073600000":0,"1514160000000":0,"1514246400000":0,"1514332800000":0,"1514419200000":0,"1514505600000":0,"1514592000000":0,"1514678400000":0,"1514764800000":0,"1514851200000":0,"1514937600000":0,"1515024000000":0,"1515110400000":0,"1515196800000":0,"1515283200000":0,"1515369600000":0,"1515456000000":0,"1515542400000":0,"1515628800000":0,"1515715200000":0,"1515801600000":0,"1515888000000":0,"1515974400000":0,"1516060800000":0,"1516147200000":0,"1516233600000":0,"1516320000000":0,"1516406400000":0,"1516492800000":0,"1516579200000":0,"1516665600000":0,"1516752000000":0,"1516838400000":0,"1516924800000":0,"1517011200000":0,"1517097600000":0,"1517184000000":0,"1517270400000":0,"1517356800000":0,"1517443200000":0,"1517529600000":0,"1517616000000":0,"1517702400000":0,"1517788800000":0,"1517875200000":0,"1517961600000":0,"1518048000000":0,"1518134400000":0,"1518220800000":0,"1518307200000":0,"1518393600000":0,"1518480000000":0,"1518566400000":0,"1518652800000":0,"1518739200000":0,"1518825600000":0,"1518912000000":0,"1518998400000":0,"1519084800000":0,"1519171200000":0,"1519257600000":0,"1519344000000":0,"1519430400000":0,"1519516800000":0,"1519603200000":0,"1519689600000":0,"1519776000000":0,"1519862400000":0,"1519948800000":0,"1520035200000":0,"1520121600000":0,"1520208000000":0,"1520294400000":0,"1520380800000":0,"1520467200000":0,"1520553600000":0,"1520640000000":0,"1520726400000":0,"1520812800000":0,"1520899200000":0,"1520985600000":0,"1521072000000":0,"1521158400000":0,"1521244800000":0,"1521331200000":0,"1521417600000":0,"1521504000000":0,"1521590400000":0,"1521676800000":0,"1521763200000":0,"1521849600000":0,"1521936000000":0,"1522022400000":0,"1522108800000":0,"1522195200000":0,"1522281600000":0,"1522368000000":0,"1522454400000":0,"1522540800000":0,"1522627200000":0,"1522713600000":0,"1522800000000":0,"1522886400000":0,"1522972800000":0,"1523059200000":0,"1523145600000":0,"1523232000000":0,"1523318400000":0,"1523404800000":0,"1523491200000":0,"1523577600000":0,"1523664000000":0,"1523750400000":0,"1523836800000":0,"1523923200000":0,"1524009600000":0,"1524096000000":0,"1524182400000":0,"1524268800000":0,"1524355200000":0,"1524441600000":0,"1524528000000":0,"1524614400000":0,"1524700800000":0,"1524787200000":0,"1524873600000":0,"1524960000000":0,"1525046400000":0,"1525132800000":0,"1525219200000":0,"1525305600000":0,"1525392000000":0,"1525478400000":0,"1525564800000":0,"1525651200000":0,"1525737600000":0,"1525824000000":0,"1525910400000":0,"1525996800000":0,"1526083200000":0,"1526169600000":0,"1526256000000":0,"1526342400000":0,"1526428800000":0,"1526515200000":0,"1526601600000":0,"1526688000000":0,"1526774400000":0,"1526860800000":0,"1526947200000":0,"1527033600000":0,"1527120000000":0,"1527206400000":0,"1527292800000":0,"1527379200000":0,"1527465600000":0,"1527552000000":0,"1527638400000":0,"1527724800000":0,"1527811200000":0,"1527897600000":0,"1527984000000":0,"1528070400000":0,"1528156800000":0,"1528243200000":0,"1528329600000":0,"1528416000000":0,"1528502400000":0,"1528588800000":0,"1528675200000":0,"1528761600000":0,"1528848000000":0,"1528934400000":0,"1529020800000":0,"1529107200000":0,"1529193600000":0,"1529280000000":0,"1529366400000":0,"1529452800000":0,"1529539200000":0,"1529625600000":0,"1529712000000":0,"1529798400000":0,"1529884800000":0,"1529971200000":0,"1530057600000":0,"1530144000000":0,"1530230400000":0,"1530316800000":0,"1530403200000":0,"1530489600000":0,"1530576000000":0,"1530662400000":0,"1530748800000":0,"1530835200000":0,"1530921600000":0,"1531008000000":0,"1531094400000":0,"1531180800000":0,"1531267200000":0,"1531353600000":0,"1531440000000":0,"1531526400000":0,"1531612800000":0,"1531699200000":0,"1531785600000":0,"1531872000000":0,"1531958400000":0,"1532044800000":0,"1532131200000":0,"1532217600000":0,"1532304000000":0,"1532390400000":0,"1532476800000":0,"1532563200000":0,"1532649600000":0,"1532736000000":0,"1532822400000":0,"1532908800000":0,"1532995200000":0,"1533081600000":0,"1533168000000":0,"1533254400000":0,"1533340800000":0,"1533427200000":0,"1533513600000":0,"1533600000000":0,"1533686400000":0,"1533772800000":0,"1533859200000":0,"1533945600000":0,"1534032000000":0,"1534118400000":0,"1534204800000":0,"1534291200000":0,"1534377600000":0,"1534464000000":0,"1534550400000":0,"1534636800000":0,"1534723200000":0,"1534809600000":0,"1534896000000":0,"1534982400000":0,"1535068800000":0,"1535155200000":0,"1535241600000":0,"1535328000000":0,"1535414400000":0,"1535500800000":0,"1535587200000":0,"1535673600000":0,"1535760000000":0,"1535846400000":0,"1535932800000":0,"1536019200000":0,"1536105600000":0,"1536192000000":0,"1536278400000":0,"1536364800000":0,"1536451200000":0,"1536537600000":0,"1536624000000":0,"1536710400000":0,"1536796800000":0,"1536883200000":0,"1536969600000":0,"1537056000000":0,"1537142400000":0,"1537228800000":0,"1537315200000":0,"1537401600000":0,"1537488000000":0,"1537574400000":0,"1537660800000":0,"1537747200000":0,"1537833600000":0,"1537920000000":0,"1538006400000":0,"1538092800000":0,"1538179200000":0,"1538265600000":0,"1538352000000":0,"1538438400000":0,"1538524800000":0,"1538611200000":0,"1538697600000":0,"1538784000000":0,"1538870400000":0,"1538956800000":0,"1539043200000":0,"1539129600000":0,"1539216000000":0,"1539302400000":0,"1539388800000":0,"1539475200000":0,"1539561600000":0,"1539648000000":0,"1539734400000":0,"1539820800000":0,"1539907200000":0,"1539993600000":0,"1540080000000":0,"1540166400000":0,"1540252800000":0,"1540339200000":0,"1540425600000":0,"1540512000000":0,"1540598400000":0,"1540684800000":0,"1540771200000":0,"1540857600000":0,"1540944000000":0,"1541030400000":0,"1541116800000":0,"1541203200000":0,"1541289600000":0,"1541376000000":0,"1541462400000":0,"1541548800000":0,"1541635200000":0,"1541721600000":0,"1541808000000":0,"1541894400000":0,"1541980800000":0,"1542067200000":0,"1542153600000":0,"1542240000000":0,"1542326400000":0,"1542412800000":0,"1542499200000":0,"1542585600000":0,"1542672000000":0,"1542758400000":0,"1542844800000":0,"1542931200000":0,"1543017600000":0,"1543104000000":0,"1543190400000":0,"1543276800000":0,"1543363200000":0,"1543449600000":0,"1543536000000":0,"1543622400000":0,"1543708800000":0,"1543795200000":0,"1543881600000":0,"1543968000000":0,"1544054400000":0,"1544140800000":0,"1544227200000":0,"1544313600000":0,"1544400000000":0,"1544486400000":0,"1544572800000":0,"1544659200000":0,"1544745600000":0,"1544832000000":0,"1544918400000":0,"1545004800000":0,"1545091200000":0,"1545177600000":0,"1545264000000":0,"1545350400000":0,"1545436800000":0,"1545523200000":0,"1545609600000":0,"1545696000000":0,"1545782400000":0,"1545868800000":0,"1545955200000":0,"1546041600000":0,"1546128000000":0,"1546214400000":0,"1546300800000":0,"1546387200000":0,"1546473600000":0,"1546560000000":0,"1546646400000":0,"1546732800000":0,"1546819200000":0,"1546905600000":0,"1546992000000":0,"1547078400000":0,"1547164800000":0,"1547251200000":0,"1547337600000":0,"1547424000000":0,"1547510400000":0,"1547596800000":0,"1547683200000":0,"1547769600000":0,"1547856000000":0,"1547942400000":0,"1548028800000":0,"1548115200000":0,"1548201600000":0,"1548288000000":0,"1548374400000":0,"1548460800000":0,"1548547200000":0,"1548633600000":0,"1548720000000":0,"1548806400000":0,"1548892800000":0,"1548979200000":0,"1549065600000":0,"1549152000000":0,"1549238400000":0,"1549324800000":0,"1549411200000":0,"1549497600000":0,"1549584000000":0,"1549670400000":0,"1549756800000":0,"1549843200000":0,"1549929600000":0,"1550016000000":0,"1550102400000":0,"1550188800000":0,"1550275200000":0,"1550361600000":0,"1550448000000":0,"1550534400000":0,"1550620800000":0,"1550707200000":0,"1550793600000":0,"1550880000000":0,"1550966400000":0,"1551052800000":0,"1551139200000":0,"1551225600000":0,"1551312000000":0,"1551398400000":0,"1551484800000":0,"1551571200000":0,"1551657600000":0,"1551744000000":0,"1551830400000":0,"1551916800000":0,"1552003200000":0,"1552089600000":0,"1552176000000":0,"1552262400000":0,"1552348800000":0,"1552435200000":0,"1552521600000":0,"1552608000000":0,"1552694400000":0,"1552780800000":0,"1552867200000":0,"1552953600000":0,"1553040000000":0,"1553126400000":0,"1553212800000":0,"1553299200000":0,"1553385600000":0,"1553472000000":0,"1553558400000":0,"1553644800000":0,"1553731200000":0,"1553817600000":0,"1553904000000":0,"1553990400000":0,"1554076800000":0,"1554163200000":0,"1554249600000":0,"1554336000000":0,"1554422400000":0,"1554508800000":0,"1554595200000":0,"1554681600000":0,"1554768000000":0,"1554854400000":0,"1554940800000":0,"1555027200000":0,"1555113600000":0,"1555200000000":0,"1555286400000":0,"1555372800000":0,"1555459200000":0,"1555545600000":0,"1555632000000":0,"1555718400000":0,"1555804800000":0,"1555891200000":0,"1555977600000":0,"1556064000000":0,"1556150400000":0,"1556236800000":0,"1556323200000":0,"1556409600000":0,"1556496000000":0,"1556582400000":0,"1556668800000":0,"1556755200000":0,"1556841600000":0,"1556928000000":0,"1557014400000":0,"1557100800000":0,"1557187200000":0,"1557273600000":0,"1557360000000":0,"1557446400000":0,"1557532800000":0,"1557619200000":0,"1557705600000":0,"1557792000000":0,"1557878400000":0,"1557964800000":0,"1558051200000":0,"1558137600000":0,"1558224000000":0,"1558310400000":0,"1558396800000":0,"1558483200000":0,"1558569600000":0,"1558656000000":0,"1558742400000":0,"1558828800000":0,"1558915200000":0,"1559001600000":0,"1559088000000":0,"1559174400000":0,"1559260800000":0,"1559347200000":0,"1559433600000":0,"1559520000000":0,"1559606400000":0,"1559692800000":0,"1559779200000":0,"1559865600000":0,"1559952000000":0,"1560038400000":0,"1560124800000":0,"1560211200000":0,"1560297600000":0,"1560384000000":0,"1560470400000":0,"1560556800000":0,"1560643200000":0,"1560729600000":0,"1560816000000":0,"1560902400000":0,"1560988800000":0,"1561075200000":0,"1561161600000":0,"1561248000000":0,"1561334400000":0,"1561420800000":0,"1561507200000":0,"1561593600000":0,"1561680000000":0,"1561766400000":0,"1561852800000":0,"1561939200000":0,"1562025600000":0,"1562112000000":0,"1562198400000":0,"1562284800000":0,"1562371200000":0,"1562457600000":0,"1562544000000":0,"1562630400000":0,"1562716800000":0,"1562803200000":0,"1562889600000":0,"1562976000000":0,"1563062400000":0,"1563148800000":0,"1563235200000":0,"1563321600000":0,"1563408000000":0,"1563494400000":0,"1563580800000":0,"1563667200000":0,"1563753600000":0,"1563840000000":0,"1563926400000":0,"1564012800000":0,"1564099200000":0,"1564185600000":0,"1564272000000":0,"1564358400000":0,"1564444800000":0,"1564531200000":0,"1564617600000":0,"1564704000000":0,"1564790400000":0,"1564876800000":0,"1564963200000":0,"1565049600000":0,"1565136000000":0,"1565222400000":0,"1565308800000":0,"1565395200000":0,"1565481600000":0,"1565568000000":0,"1565654400000":0,"1565740800000":0,"1565827200000":0,"1565913600000":0,"1566000000000":0,"1566086400000":0,"1566172800000":0,"1566259200000":0,"1566345600000":0,"1566432000000":0,"1566518400000":0,"1566604800000":0,"1566691200000":0,"1566777600000":0,"1566864000000":0,"1566950400000":0,"1567036800000":0,"1567123200000":0,"1567209600000":0,"1567296000000":0,"1567382400000":0,"1567468800000":0,"1567555200000":0,"1567641600000":0,"1567728000000":0,"1567814400000":0,"1567900800000":0,"1567987200000":0,"1568073600000":0,"1568160000000":0,"1568246400000":0,"1568332800000":0,"1568419200000":0,"1568505600000":0,"1568592000Source: phpredis/phpredis