php-src/Zend/tests/parent_class_name_without_parent.phpt

22 lines
315 B
Plaintext
Raw Normal View History

--TEST--
Getting parent class name when there is no parent generates an error
--FILE--
<?php
trait T {
public function f() {
var_dump(parent::class);
}
}
class C {
use T;
}
(new C)->f();
?>
--EXPECTF--
Fatal error: Cannot use "parent" when current class scope has no parent in %s on line 5