1--TEST-- 2Hook AST printing 3--FILE-- 4<?php 5 6try { 7 assert(false && new class { 8 public $prop1 { get; set; } 9 public $prop2 { 10 get { 11 return parent::$prop1::get(); 12 } 13 final set { 14 echo 'Foo'; 15 $this->prop1 = 42; 16 } 17 } 18 public $prop3 = 1 { 19 get => 42; 20 } 21 }); 22} catch (Error $e) { 23 echo $e->getMessage(), "\n"; 24} 25 26?> 27--EXPECT-- 28assert(false && new class { 29 public $prop1 { 30 get; 31 set; 32 } 33 public $prop2 { 34 get { 35 return parent::$prop1::get(); 36 } 37 final set { 38 echo 'Foo'; 39 $this->prop1 = 42; 40 } 41 } 42 public $prop3 = 1 { 43 get => 42; 44 } 45}) 46