php-src/Zend/tests/ctor_promotion_trait.phpt
2020-06-05 15:15:51 +02:00

22 lines
257 B
PHP

--TEST--
Constructor promotion can be used inside a trait
--FILE--
<?php
trait Test {
public function __construct(public $prop) {}
}
class Test2 {
use Test;
}
var_dump(new Test2(42));
?>
--EXPECT--
object(Test2)#1 (1) {
["prop"]=>
int(42)
}