TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
880 B

<?php
use TypePhp\Exception\TestError;
/**
* A static property and an instance property are different kinds of storage;
* Zend forbids redeclaring one as the other in either direction ("Cannot
* redeclare static A::$x as non static B::$x" and vice versa).
*/
class StaticPropertyOverrideTest extends BaseTest
{
public function testMatchingStaticnessCompiles(): void
{
$this->compile('property_static_match.php');
}
public function testStaticCannotBecomeInstance(): void
{
$this->exec(
'Cannot redeclare static `A::$x` as non static `B::$x`',
'property_static_mismatch.php',
);
}
public function testInstanceCannotBecomeStatic(): void
{
$this->exec(
'Cannot redeclare non static `A::$x` as static `B::$x`',
'property_nonstatic_mismatch.php',
);
}
}