summaryrefslogtreecommitdiff
path: root/Zend/tests/throw/leaks.phpt
blob: 072f65f2fc80c7a954528d77a5bb87c09863f90d (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
--TEST--
throw expression should not leak temporaries
--FILE--
<?php

try {
    new stdClass(throw new Exception);
} catch (Exception $e) {
    echo "Caught\n";
}

try {
    $a = [];
    ($a + [1]) + throw new Exception;
} catch (Exception $e) {
    echo "Caught\n";
}

try {
    @throw new Exception;
} catch (Exception $e) {
    echo "Caught\n";
}
var_dump(error_reporting());

?>
--EXPECT--
Caught
Caught
Caught
int(32767)