MCPcopy Create free account
hub / github.com/deuill/go-php / receiver_new

Function receiver_new

engine/receiver.c:95–112  ·  view source on GitHub ↗

Create new method receiver instance and attach to instantiated PHP object. Returns an exception if method receiver failed to initialize for any reason.

Source from the content-addressed store, hash-verified

93// Create new method receiver instance and attach to instantiated PHP object.
94// Returns an exception if method receiver failed to initialize for any reason.
95static void receiver_new(INTERNAL_FUNCTION_PARAMETERS) {
96 engine_receiver *this = RECEIVER_THIS(getThis());
97 zval args;
98
99 array_init_size(&args, ZEND_NUM_ARGS());
100
101 if (zend_copy_parameters_array(ZEND_NUM_ARGS(), &args) == FAILURE) {
102 zend_throw_exception(NULL, "Could not parse parameters for method receiver", 0);
103 } else {
104 // Create receiver instance. Throws an exception if creation fails.
105 int result = engineReceiverNew(this, (void *) &args);
106 if (result != 0) {
107 zend_throw_exception(NULL, "Failed to instantiate method receiver", 0);
108 }
109 }
110
111 zval_dtor(&args);
112}
113
114// Fetch and return function definition for method receiver. The method call
115// happens in the method handler, as returned by this function.

Callers

nothing calls this directly

Calls 1

engineReceiverNewFunction · 0.85

Tested by

no test coverage detected