Download src/php/php-src/ext/session/tests/023.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/session/tests/023.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/session/tests/023.phpt
-
curl -L -o 023.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/session/tests/023.phpt
879 Bytes
| --TEST-- | |
| session object deserialization | |
| --EXTENSIONS-- | |
| session | |
| --SKIPIF-- | |
| include('skipif.inc'); | |
| --INI-- | |
| session.use_cookies=0 | |
| session.use_strict_mode=0 | |
| session.cache_limiter= | |
| session.serialize_handler=php | |
| session.save_handler=files | |
| --FILE-- | |
| error_reporting(E_ALL); | |
| class foo { | |
| public $bar = "ok"; | |
| public $yes; | |
| function method() { $this->yes++; } | |
| } | |
| session_id("test023"); | |
| session_start(); | |
| session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'); | |
| $baz = $_SESSION['baz']; | |
| $arr = $_SESSION['arr']; | |
| $baz->method(); | |
| $arr[3]->method(); | |
| var_dump($baz); | |
| var_dump($arr); | |
| session_destroy(); | |
| --EXPECT-- | |
| object(foo)#1 (2) { | |
| ["bar"]=> | |
| string(2) "ok" | |
| ["yes"]=> | |
| int(2) | |
| } | |
| array(1) { | |
| [3]=> | |
| object(foo)#2 (2) { | |
| ["bar"]=> | |
| string(2) "ok" | |
| ["yes"]=> | |
| int(2) | |
| } | |
| } | |