Annotation of embedaddon/php/ext/standard/tests/streams/bug44818.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #44818 (php://memory writeable when opened read only)
        !             3: --FILE--
        !             4: <?php
        !             5: function test($url, $mode) {
        !             6:        echo "$url, $mode\n";
        !             7:        $fd = fopen($url, $mode);
        !             8:        var_dump($fd, fwrite($fd, b"foo"));
        !             9:        var_dump(fseek($fd, 0, SEEK_SET), fread($fd, 3));
        !            10:        fclose($fd);
        !            11: }
        !            12: test("php://memory","r");
        !            13: test("php://memory","r+");
        !            14: test("php://temp","r");
        !            15: test("php://temp","w");
        !            16: ?>
        !            17: --EXPECTF--
        !            18: php://memory, r
        !            19: resource(%d) of type (stream)
        !            20: int(0)
        !            21: int(0)
        !            22: string(0) ""
        !            23: php://memory, r+
        !            24: resource(%d) of type (stream)
        !            25: int(3)
        !            26: int(0)
        !            27: string(3) "foo"
        !            28: php://temp, r
        !            29: resource(%d) of type (stream)
        !            30: int(0)
        !            31: int(0)
        !            32: string(0) ""
        !            33: php://temp, w
        !            34: resource(%d) of type (stream)
        !            35: int(3)
        !            36: int(0)
        !            37: string(3) "foo"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>