summaryrefslogtreecommitdiff
path: root/Zend/tests/assert/indirect_var_access_misoptimization.phpt
blob: 02327f30c026690b832f6dcc3010a847e8bc86e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Misoptimization when variable is modified by assert()
--INI--
zend.assertions=1
--FILE--
<?php

function test() {
    $i = 0;
    assert('$i = new stdClass');
    $i += 1;
    var_dump($i);
}
test();

?>
--EXPECTF--
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d

Notice: Object of class stdClass could not be converted to number in %s on line %d
int(2)