Download src/php/php-src/ext/session/tests/001.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/session/tests/001.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/session/tests/001.phpt
-
curl -L -o 001.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/session/tests/001.phpt
698 Bytes
| --TEST-- | |
| session object serialization | |
| --EXTENSIONS-- | |
| session | |
| --SKIPIF-- | |
| include('skipif.inc'); | |
| --INI-- | |
| session.use_cookies=0 | |
| session.cache_limiter= | |
| session.serialize_handler=php | |
| session.save_handler=files | |
| --FILE-- | |
| error_reporting(E_ALL); | |
| class foo { | |
| public $bar = "ok"; | |
| function method() { $this->yes = "done"; } | |
| } | |
| $baz = new foo; | |
| $baz->method(); | |
| $arr[3] = new foo; | |
| $arr[3]->method(); | |
| session_start(); | |
| $_SESSION["baz"] = $baz; | |
| $_SESSION["arr"] = $arr; | |
| print session_encode()."\n"; | |
| session_destroy(); | |
| --EXPECT-- | |
| baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}} | |