Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Dec 21, 2023
1 parent f62c4a1 commit 81eb3ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/phpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ bool ZendCallable_Check(PyObject *pv);
void debug_dump(uint32_t i, zval *item);
void debug_dump(uint32_t i, PyObject *pObj);
void var_dump(zval *var);
void debug_var_dump(zval *var);

bool py_module_string_init(PyObject *m);
bool py_module_object_init(PyObject *m);
Expand Down
8 changes: 7 additions & 1 deletion src/bridge/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ END_EXTERN_C()

using phpy::CallObject;

const int var_dump_level = 3;

static void (*py2php_fn)(PyObject *pv, zval *zv);
static void py2php_object_impl(PyObject *pv, zval *zv);
static void py2php_scalar_impl(PyObject *pv, zval *zv);
Expand Down Expand Up @@ -332,7 +334,11 @@ void debug_dump(uint32_t i, PyObject *pObj) {
}

void var_dump(zval *var) {
php_var_dump(var, 3);
php_var_dump(var, var_dump_level);
}

void debug_var_dump(zval *var) {
php_debug_zval_dump(var, var_dump_level);
}

CallObject::CallObject(PyObject *_fn, zval *_return_value, uint32_t _argc, zval *_argv, zend_array *_kwargs) {
Expand Down
1 change: 0 additions & 1 deletion src/python/object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ static PyObject *Object_invoke(ZendObject *self, PyObject *args, PyObject *kwds)
phpy::python::tuple2argv(argv, args, argc, 0);
zend_result result = phpy::php::call_fn(NULL, &self->object, &retval, argc, argv);
ON_SCOPE_EXIT {
zval_ptr_dtor(&retval);
phpy::python::release_argv(argc, argv);
delete[] argv;
};
Expand Down

0 comments on commit 81eb3ff

Please sign in to comment.