1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 04:32:19 +02:00
Files
archived-php-src/ext/opcache/tests/jit/fetch_obj_003.phpt
2019-10-02 10:34:08 +02:00

47 lines
639 B
PHP

--TEST--
JIT: FETCH_OBJ 003
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
class C {
var $a = 0;
}
function foo() {
$x = new C;
$x->a = 1;
unset($x->a);
$x->a += 2;
var_dump($x);
}
function bar() {
$x = new C;
$x->a = 1;
$x->b = 2;
unset($x->a);
$x->a += 2;
var_dump($x);
}
foo();
bar();
?>
--EXPECTF--
Warning: Undefined property: C::$a in %s on line %d
object(C)#1 (1) {
["a"]=>
int(2)
}
Warning: Undefined property: C::$a in %s on line %d
object(C)#1 (2) {
["a"]=>
int(2)
["b"]=>
int(2)
}