/* R, W, RW */
extern const char *php_pq_strmode(long mode);
-/* compare array index */
-#if PHP_VERSION_ID >= 80000
-extern int php_pq_compare_index(Bucket *lptr, Bucket *rptr);
-#else
-extern int php_pq_compare_index(const void *lptr, const void *rptr);
-#endif
-
/* free zval ptr values (as hash dtor) */
extern void php_pq_hash_ptr_dtor(zval *p);
/* ZE compat */
#if PHP_VERSION_ID >= 80000
+extern int php_pq_compare_index(Bucket *lptr, Bucket *rptr);
+
# define php_pq_call_method(objval_ptr, method_name, num_args, ...) \
zend_call_method_with_ ## num_args ## _params( \
Z_OBJ_P(objval_ptr), Z_OBJCE_P(objval_ptr), NULL, \
(Z_OBJ_HT_P(objval_ptr)->cast_object && \
SUCCESS == Z_OBJ_HT_P(objval_ptr)->cast_object(Z_OBJ_P(objval_ptr), (retval_ptr), (cast_type)))
#else
+
+extern int php_pq_compare_index(const void *lptr, const void *rptr);
+
+# define zend_ze_countable spl_ce_Countable
+
# define php_pq_call_method(objval_ptr, method_name, num_args, ...) \
zend_call_method_with_ ## num_args ## _params( \
(objval_ptr), NULL, NULL, \
php_pqres_class_entry->create_object = php_pqres_create_object;
php_pqres_class_entry->get_iterator = php_pqres_iterator_init;
#if PHP_VERSION_ID >= 80000
- zend_class_implements(php_pqres_class_entry, 2, zend_ce_aggregate, spl_ce_Countable);
+ zend_class_implements(php_pqres_class_entry, 2, zend_ce_aggregate, zend_ce_countable);
#else
- zend_class_implements(php_pqres_class_entry, 2, zend_ce_traversable, spl_ce_Countable);
+ zend_class_implements(php_pqres_class_entry, 2, zend_ce_traversable, zend_ce_countable);
#endif
memcpy(&php_pqres_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
public $dummy = 2;
}
-var_dump(new pq\Result, get_object_vars(new r));
+var_dump(new pq\Result);
+
+echo "Test\n";
+$v = get_object_vars(new r);
+ksort($v);
+var_dump($v);
+
?>
Done
--EXPECTF--
Warning: pq\Result not initialized in %s on line %d
Warning: pq\Result not initialized in %s on line %d
+object(pq\Result)#%d (9) {
+ ["status"]=>
+ NULL
+ ["statusMessage"]=>
+ NULL
+ ["errorMessage"]=>
+ NULL
+ ["diag"]=>
+ NULL
+ ["numRows"]=>
+ int(0)
+ ["numCols"]=>
+ int(0)
+ ["affectedRows"]=>
+ int(0)
+ ["fetchType"]=>
+ int(0)
+ ["autoConvert"]=>
+ int(65535)
+}
+Test
Warning: pq\Result not initialized in %s on line %d
Warning: pq\Result not initialized in %s on line %d
Warning: pq\Result not initialized in %s on line %d
-object(pq\Result)#%d (9) {
- ["status"]=>
- NULL
- ["statusMessage"]=>
- NULL
- ["errorMessage"]=>
- NULL
- ["diag"]=>
- NULL
- ["numRows"]=>
- int(0)
- ["numCols"]=>
- int(0)
+array(10) {
["affectedRows"]=>
int(0)
- ["fetchType"]=>
- int(0)
["autoConvert"]=>
int(65535)
-}
-array(10) {
+ ["diag"]=>
+ NULL
["dummy"]=>
int(2)
- ["status"]=>
- NULL
- ["statusMessage"]=>
- NULL
["errorMessage"]=>
NULL
- ["diag"]=>
- NULL
- ["numRows"]=>
+ ["fetchType"]=>
int(0)
["numCols"]=>
int(0)
- ["affectedRows"]=>
- int(0)
- ["fetchType"]=>
+ ["numRows"]=>
int(0)
- ["autoConvert"]=>
- int(65535)
+ ["status"]=>
+ NULL
+ ["statusMessage"]=>
+ NULL
}
Done