0
PHP_METHOD(Car, cls_ref)
{
Car *car;
//Car2 *obj11;
Car2 *car2;
zval* obj11;
zend_class_entry ce2 = zend_fetch_class("Car2", sizeof("Car2")-1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj11,ce2) == FAILURE) {
RETURN_NULL();
}
car_object *obj = (car_object *)zend_object_store_get_object(
getThis() TSRMLS_CC);
/* car2_object *objj = (car2_object *)zend_object_store_get_object(
getThis() TSRMLS_CC);
car2=(objj->car2);
*/
car = obj->car;
if (car != NULL) {
//cout<<"in car 2 ref"<<endl;
//car2->reference(s);
// (car->cls_ref((Car2&)car2));
car->cls_ref((Car2&)obj11);
}
}
where void Car::cls_ref(Car2 &obj){...}
我解決這個問題。我有錯誤:
error: cannot convert ‘Car2*’ to ‘zval*’ in initialization /home/vehicles.cc:191: error: conversion from ‘zend_class_entry*’ to non-scalar type ‘zend_class_entry’ requested `(the errors are at the point where i intialize obj11 and at ce2=..)