summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/jit/bug80745.phpt
blob: 66956f4139f58461ec30d90c0c1785047d4cf6c2 (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
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
Bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit=function
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php

final class Message
{
    public $qr = false;

    public $opcode = 0;

    public $aa = false;
}

echo "Starting...\n";

function headerToBinary(Message $message)
{
        $flags = 0;
        $flags = ($flags << 1) | ($message->qr ? 1 : 0);
        $flags = ($flags << 4) | $message->opcode;
        var_dump($flags);
        $flags = ($flags << 1) | ($message->aa ? 1 : 0);
}

headerToBinary(new Message());

echo "PROBLEM NOT REPRODUCED !\n";
?>
--EXPECT--
Starting...
int(0)
PROBLEM NOT REPRODUCED !