Skip to content

Commit 7b8e1ee

Browse files
committed
fix: randomizer: cleanup write property
1 parent fff8c11 commit 7b8e1ee

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/random/randomizer.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ PHP_METHOD(Random_Randomizer, __construct)
6464
php_random_randomizer *randomizer = Z_RANDOM_RANDOMIZER_P(ZEND_THIS);
6565
zend_object *engine_object = NULL;
6666
zval zengine_object;
67-
zend_string *pname;
6867

6968
ZEND_PARSE_PARAMETERS_START(0, 1)
7069
Z_PARAM_OPTIONAL
@@ -81,10 +80,7 @@ PHP_METHOD(Random_Randomizer, __construct)
8180

8281
ZVAL_OBJ(&zengine_object, engine_object);
8382

84-
/* Write property */
85-
pname = zend_string_init("engine", sizeof("engine") - 1, 0);
86-
zend_std_write_property(&randomizer->std, pname, &zengine_object, NULL);
87-
zend_string_release(pname);
83+
zend_update_property(random_ce_Random_Randomizer, Z_OBJ_P(ZEND_THIS), "engine", strlen("engine"), &zengine_object);
8884

8985
randomizer_common_init(randomizer, engine_object);
9086
}

0 commit comments

Comments
 (0)