1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00
Files
archived-php-src/Zend/tests/gh10251.phpt
Christoph M. Becker 6faeb9571d Fix recently introduced gh10251.phpt
As of PHP 8.2.0, creation of dynamic properties is deprecated, so we
slap a `AllowDynamicProperties` attribute on the class.
2023-01-08 18:07:21 +01:00

26 lines
506 B
PHP

--TEST--
GH-10251 (Assertion `(flag & (1<<3)) == 0' failed.)
--FILE--
<?php
#[\AllowDynamicProperties]
class A
{
function __set($o, $l)
{
$this->$p = $v;
}
}
$a = new A();
$pp = "";
$op = $pp & "";
// Bitwise operators on strings don't compute the hash.
// The code below previously assumed a hash was actually computed, leading to a crash.
$a->$op = 0;
echo "Done\n";
?>
--EXPECTF--
Warning: Undefined variable $v in %s on line %d
Warning: Undefined variable $p in %s on line %d
Done