xref: /PHP-8.1/ext/opcache/tests/jit/mod_003.phpt (revision f0f774a1)
1--TEST--
2JIT MOD: 003
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.protect_memory=1
9opcache.jit=function
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14class Test {
15    public $prop = 0;
16}
17function test1($test) {
18    $test[0] %= 3;
19    return $test;
20}
21function test2($test) {
22    $test->prop %= 3;
23    return $test;
24}
25var_dump(test1([0]));
26var_dump(test2(new Test));
27?>
28--EXPECT--
29array(1) {
30  [0]=>
31  int(0)
32}
33object(Test)#1 (1) {
34  ["prop"]=>
35  int(0)
36}
37