methods_003.phpt 334 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Testing __construct and __destruct with Trait
  3. --FILE--
  4. <?php
  5. trait foo {
  6. public function __construct() {
  7. var_dump(__FUNCTION__);
  8. }
  9. public function __destruct() {
  10. var_dump(__FUNCTION__);
  11. }
  12. }
  13. class bar {
  14. use foo;
  15. }
  16. new bar;
  17. ?>
  18. --EXPECT--
  19. string(11) "__construct"
  20. string(10) "__destruct"