mirror of
https://github.com/php/php-src.git
synced 2026-04-02 21:52:36 +02:00
As of PHP 8.2.0, creation of dynamic properties is deprecated, so we slap a `AllowDynamicProperties` attribute on the class.
26 lines
506 B
PHP
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
|