http\Message\Body
[mdref/mdref-http] / http / Message / Body / stat.md
1 # mixed http\Message\Body::stat([string $field = NULL])
2
3 Stat size, atime, mtime and/or ctime.
4
5 ## Params:
6
7 * Optional string $field = NULL
8 A single stat field to retrieve.
9
10 ## Returns:
11
12 * int, the requested stat field.
13 * object, stdClass instance holding all four stat fields.
14
15 ## Example:
16
17 <?php
18 $body = new http\Message\Body(fopen(__FILE__, "r"));
19 var_dump($body->stat(), $body->stat()->size, $body->stat("s"));
20 ?>
21
22 Yields:
23
24 object(stdClass)#2 (4) {
25 ["size"]=>
26 int(661)
27 ["atime"]=>
28 int(1383830756)
29 ["mtime"]=>
30 int(1383830753)
31 ["ctime"]=>
32 int(1383830753)
33 }
34 int(661)
35 int(661)