1--TEST-- 2ReflectionProperty::isFinal() 3--FILE-- 4<?php 5 6class C { 7 public $p1; 8 public final $p2; 9 public $p3 { get => 42; } 10 public final $p4 { get => 42; } 11 public protected(set) mixed $p5; 12 public protected(set) final mixed $p6; 13 public private(set) mixed $p7; 14 public private(set) final mixed $p8; 15} 16 17$rc = new ReflectionClass(C::class); 18foreach ($rc->getProperties() as $rp) { 19 echo $rp->getName(), ": "; 20 var_dump($rp->isFinal()); 21} 22 23?> 24--EXPECT-- 25p1: bool(false) 26p2: bool(true) 27p3: bool(false) 28p4: bool(true) 29p5: bool(false) 30p6: bool(true) 31p7: bool(true) 32p8: bool(true) 33