summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/typed_properties_061.phpt
blob: b946b2d2597d93b882c5e17bd7565af3ac6f758d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--TEST--
Typed property on overloaded by-ref property
--SKIPIF--
<?php if (PHP_INT_SIZE == 4) die("SKIP: 64 bit test"); ?>
--FILE--
<?php

$a = new class {
    public int $foo = 1;

    function &__get($x) {
        return $this->foo;
    }

    function __set($x, $y) {
        echo "set($y)\n";
    }
};

$a->_ += 1;
var_dump($a->foo);

$a->_ .= "1";
var_dump($a->foo);

$a->_ .= "e50";
var_dump($a->foo);

$a->_--;
var_dump($a->foo);

--$a->_;
var_dump($a->foo);

$a->foo = PHP_INT_MAX;

$a->_++;
var_dump($a->foo);

++$a->_;
var_dump($a->foo);

?>
--EXPECT--
set(2)
int(1)
set(11)
int(1)
set(1e50)
int(1)
set(0)
int(1)
set(0)
int(1)
set(9.2233720368548E+18)
int(9223372036854775807)
set(9.2233720368548E+18)
int(9223372036854775807)