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

[1.12] IteratorAggregate for Cookie #653

Open
wants to merge 1 commit into
base: 1.12
Choose a base branch
from

Commits on Oct 24, 2024

  1. IteratorAggregate for Cookie

    Was in a situation where I wanted a plain-array version of Cookie, was a little sad that I couldn't unpack it.
    Previously:
    var_dump([...$cookie]);
    
    object(TypeError)#1261 (7) {
      ["message":protected]=>
      string(44) "Only arrays and Traversables can be unpacked"
      ["string":"Error":private]=>
      string(0) ""
      ["code":protected]=>
      int(0)
    (...)
    
    Now:
    var_dump([...$cookie]);
    array(13) {
      ["name"]=>
      string(9) "PHPSESSID"
      ["value"]=>
      string(26) "<censored>"
      ["domain"]=>
      string(13) "<censored>"
      ["path"]=>
      string(1) "/"
      ["expires"]=>
      int(-1)
      ["size"]=>
      int(35)
      ["httpOnly"]=>
      bool(true)
      ["secure"]=>
      bool(false)
      ["session"]=>
      bool(true)
      ["priority"]=>
      string(6) "Medium"
      ["sameParty"]=>
      bool(false)
      ["sourceScheme"]=>
      string(6) "Secure"
      ["sourcePort"]=>
      int(443)
    }
    divinity76 authored Oct 24, 2024
    Configuration menu
    Copy the full SHA
    3879aae View commit details
    Browse the repository at this point in the history