1--TEST--
2new self / new parent in constant expression
3--FILE--
4<?php
5
6class A {
7    public static function invalid($x = new parent) {
8    }
9}
10class B extends A {
11    public static function method($x = new self, $y = new parent) {
12        var_dump($x, $y);
13    }
14}
15
16function invalid($x = new self) {}
17
18B::method();
19
20try {
21    invalid();
22} catch (Error $e) {
23    echo $e->getMessage(), "\n";
24}
25
26try {
27    B::invalid();
28} catch (Error $e) {
29    echo $e->getMessage(), "\n";
30}
31
32?>
33--EXPECT--
34object(B)#1 (0) {
35}
36object(A)#2 (0) {
37}
38Cannot access "self" when no class scope is active
39Cannot access "parent" when current class scope has no parent
40