diff --git a/perf/class-static-prop.php b/perf/class-static-prop.php index 7e066911..01854fa3 100644 --- a/perf/class-static-prop.php +++ b/perf/class-static-prop.php @@ -3,6 +3,7 @@ use native_types; class Foo { static public int $a; + static public object $o; } function isset_static(int $n) { @@ -19,7 +20,18 @@ function static_prop_add(int $n) { var_dump(Foo::$a); } +function static_prop_add_object(int $n) +{ + Foo::$o = new stdClass(); + Foo::$o->a = 'hello world'; + for ($i = 0; $i < $n; ++$i) { + $x = isset(Foo::$o); + } + var_dump(Foo::$o); +} + function main(): void { - isset_static(100000); - static_prop_add(100000); +// isset_static(100000); +// static_prop_add(100000); + static_prop_add_object(1000); } \ No newline at end of file