feat(native): add native property assignment operation with class constant

- Introduce NativePropertyAssignOpClassConstBox class with flags property
- Implement clearPublic method using bitwise AND assignment operator
- Add native_property_assign_op_class_const function for testing
- Demonstrate bitwise operation with ReflectionClassConstant::IS_PUBLIC
- Support integer type declaration for flags property
- Enable
pull/16/head
韩天峰 2 months ago
parent e5dbf10ceb
commit b4a2de7ace
  1. 18
      phpunit/code/native-property-assign-op-class-const.php

@ -0,0 +1,18 @@
<?php
class NativePropertyAssignOpClassConstBox
{
public int $flags = 7;
public function clearPublic(): int
{
$this->flags &= ~ReflectionClassConstant::IS_PUBLIC;
return $this->flags;
}
}
function native_property_assign_op_class_const(): int
{
$box = new NativePropertyAssignOpClassConstBox();
return $box->clearPublic();
}
Loading…
Cancel
Save