--TEST-- Readonly property reflection --FILE-- isReadOnly()); var_dump(($rp->getModifiers() & ReflectionProperty::IS_READONLY) != 0); $rp = new ReflectionProperty(Test::class, 'ro'); var_dump($rp->isReadOnly()); var_dump(($rp->getModifiers() & ReflectionProperty::IS_READONLY) != 0); $rp = new ReflectionProperty(Test::class, 'ro'); echo $rp; ?> --EXPECT-- bool(false) bool(false) bool(true) bool(true) Property [ public protected(set) readonly int $ro ]