summaryrefslogtreecommitdiff
path: root/Zend/tests/ctor_promotion_trait.phpt
blob: 4c109157ae7eec0b6b59c0f79f83e708471ffc58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--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)
}