From 1967950dc33b87a5b92c33875885cfb0b5b5bffc Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 1 May 2017 12:14:53 +0200 Subject: [PATCH] Fix typo in SplFixedArray has_dimension implementation --- ext/spl/spl_fixedarray.c | 2 +- ...SplFixedArray_override_offsetGet_only.phpt | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ext/spl/tests/SplFixedArray_override_offsetGet_only.phpt diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index ab81d9e351..87c59261c0 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -507,7 +507,7 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c intern = Z_SPLFIXEDARRAY_P(object); - if (intern->fptr_offset_get) { + if (intern->fptr_offset_has) { zval rv; SEPARATE_ARG_IF_REF(offset); zend_call_method_with_1_params(object, intern->std.ce, &intern->fptr_offset_has, "offsetExists", &rv, offset); diff --git a/ext/spl/tests/SplFixedArray_override_offsetGet_only.phpt b/ext/spl/tests/SplFixedArray_override_offsetGet_only.phpt new file mode 100644 index 0000000000..4ad03a4c34 --- /dev/null +++ b/ext/spl/tests/SplFixedArray_override_offsetGet_only.phpt @@ -0,0 +1,22 @@ +--TEST-- +Overriding SplFixedArray::offsetGet() only +--FILE-- + +--EXPECT-- +bool(false) +bool(true) +string(10) "prefix_abc" -- 2.40.0