xref: /PHP-8.1/Zend/tests/gh10251.phpt (revision d03025bf)
1--TEST--
2GH-10251 (Assertion `(flag & (1<<3)) == 0' failed.)
3--FILE--
4<?php
5class A
6{
7    function __set($o, $l)
8    {
9        $this->$p = $v;
10    }
11}
12$a = new A();
13$pp = "";
14$op = $pp & "";
15// Bitwise operators on strings don't compute the hash.
16// The code below previously assumed a hash was actually computed, leading to a crash.
17$a->$op = 0;
18echo "Done\n";
19?>
20--EXPECTF--
21Warning: Undefined variable $v in %s on line %d
22
23Warning: Undefined variable $p in %s on line %d
24Done
25