summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_getters_with_ref_props.phpt
blob: d3dcd8326f507fa459ecfd9968ee10fa67bf5091 (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
--TEST--
Calling exception getters when properties hold references
--FILE--
<?php

class MyException extends Exception {
    public function __construct(&$refMsg, &$refCode, &$refFile, &$refLine) {
        $this->message =& $refMsg;
        $this->code =& $refCode;
        $this->file =& $refFile;
        $this->line =& $refLine;
    }
}

$refMsg = "foo";
$refCode = 0;
$refFile = "foobar";
$refLine = 42;
$ex = new MyException($refMsg, $refCode, $refFile, $refLine);
var_dump($ex->getMessage());
var_dump($ex->getCode());
var_dump($ex->getFile());
var_dump($ex->getLine());

?>
--EXPECT--
string(3) "foo"
int(0)
string(6) "foobar"
int(42)