Warning: Undefined variable $b in %s on line %d
int(1)
-Warning: Trying to get property '1' of non-object in %s on line %d
+Warning: Attempt to read property '1' on int in %s on line %d
NULL
-Warning: Trying to get property '1' of non-object in %s on line %d
+Warning: Attempt to read property '1' on int in %s on line %d
NULL
Warning: Undefined variable $c in %s on line %d
Warning: Trying to access array offset on value of type null in %s on line %d
-Warning: Trying to get property '1' of non-object in %s on line %d
+Warning: Attempt to read property '1' on int in %s on line %d
-Warning: Trying to get property '' of non-object in %s on line %d
+Warning: Attempt to read property '' on null in %s on line %d
NULL
?>
--EXPECTF--
-Warning: Trying to get property 'a' of non-object in %s on line %d
+Warning: Attempt to read property 'a' on null in %s on line %d
ok
-Attempt to assign property 'a' of non-object
+Attempt to assign property 'a' on null
ok
Warning: Trying to access array offset on value of type null in %s on line %d
-Warning: Trying to get property 'foo' of non-object in %s on line %d
-Attempt to assign property 'foo' of non-object
-Attempt to assign property 'bar' of non-object
+Warning: Attempt to read property 'foo' on null in %s on line %d
+Attempt to assign property 'foo' on null
+Attempt to assign property 'bar' on null
Illegal offset type
Illegal offset type
Cannot use a scalar value as an array
-Attempt to assign property 'foo' of non-object
-Attempt to assign property 'foo' of non-object
+Attempt to assign property 'foo' on bool
+Attempt to assign property 'foo' on bool
ok
ok
-Warning: Trying to get property 'wrong' of non-object in %s on line %d
+Warning: Attempt to read property 'wrong' on string in %s on line %d
ok
Warning: Illegal string offset 'wrong' in %s on line %d
$s = "hello";
$a = true;
-echo "--> read access: ";
+echo "--> read access:";
echo $a->p;
echo "\n--> direct assignment:\n";
var_dump($a);
?>
--EXPECTF--
---> read access:
-Warning: Trying to get property 'p' of non-object in %s on line %d
+--> read access:
+Warning: Attempt to read property 'p' on bool in %s on line %d
--> direct assignment:
-Attempt to assign property 'p' of non-object
+Attempt to assign property 'p' on bool
--> increment:
-Attempt to increment/decrement property 'p' of non-object
+Attempt to increment/decrement property 'p' on bool
--> reference assignment:
-Attempt to modify property 'p' of non-object
+Attempt to modify property 'p' on bool
--> reference assignment:
-Attempt to modify property 'p' of non-object
+Attempt to modify property 'p' on bool
--> indexed assignment:
-Attempt to modify property 'p' of non-object
+Attempt to modify property 'p' on bool
--> Confirm assignments have had no impact:
bool(true)
--EXPECTF--
Warning: Undefined variable $a in %s on line %d
-Warning: Trying to get property 'ab' of non-object in %s on line %d
+Warning: Attempt to read property 'ab' on null in %s on line %d
?>
--EXPECTF--
Warning: Undefined variable $x in %s on line %d
-Attempt to assign property 'a' of non-object
+Attempt to assign property 'a' on null
Warning: Undefined variable $x in %s on line %d
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $x in %s on line %d
-Attempt to increment/decrement property 'a' of non-object
+Attempt to increment/decrement property 'a' on null
Warning: Undefined variable $x in %s on line %d
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $x in %s on line %d
-Attempt to assign property 'a' of non-object
+Attempt to assign property 'a' on null
Warning: Undefined variable $x in %s on line %d
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $x in %s on line %d
}
array(0) {
}
-Attempt to assign property 'a' of non-object
+Attempt to assign property 'a' on null
NULL
object(stdClass)#3 (1) {
["a"]=>
var_dump($d);
?>
--EXPECTF--
-Fatal error: Uncaught Error: Attempt to modify property 'd' of non-object in %s:%d
+Fatal error: Uncaught Error: Attempt to modify property 'd' on null in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
?>
--EXPECTF--
-Attempt to assign property 'a' of non-object
+Attempt to assign property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
{
return $this->$v /= 0;
}
-};
+}
$x = new T;
$x->x = 1;
--EXPECTF--
Warning: Undefined variable $undefined in %s on line %d
-Warning: Trying to get property '1' of non-object in %s on line %d
+Warning: Attempt to read property '1' on null in %s on line %d
-Warning: Division by zero in %sbug76667.php on line %d
+Warning: Division by zero in %s on line %d
Warning: Undefined variable $undefined in %s on line %d
-Warning: Trying to get property 'NAN' of non-object in %s on line %d
+Warning: Attempt to read property 'NAN' on null in %s on line %d
-Warning: Division by zero in %sbug76667.php on line %d
+Warning: Division by zero in %s on line %d
Warning: Undefined variable $undefined in %s on line %d
-Warning: Trying to get property 'NAN' of non-object in %s on line %d
+Warning: Attempt to read property 'NAN' on null in %s on line %d
-Warning: Division by zero in %sbug76667.php on line %d
+Warning: Division by zero in %s on line %d
var_dump($var);
?>
--EXPECT--
-Attempt to modify property 'prop' of non-object
+Attempt to modify property 'prop' on null
NULL
?>
--EXPECTF--
Warning: Undefined variable $u1 in %s on line %d
-Attempt to assign property 'a' of non-object
+Attempt to assign property 'a' on null
Warning: Undefined variable $u2 in %s on line %d
-Attempt to increment/decrement property 'a' of non-object
+Attempt to increment/decrement property 'a' on null
Warning: Undefined variable $u3 in %s on line %d
-Attempt to increment/decrement property 'a' of non-object
+Attempt to increment/decrement property 'a' on null
Warning: Undefined variable $u4 in %s on line %d
-Attempt to modify property 'a' of non-object
+Attempt to modify property 'a' on null
--EXPECTF--
Warning: Trying to access array offset on value of type null in %s on line %d
-Warning: Trying to get property 'a' of non-object in %s on line %d
+Warning: Attempt to read property 'a' on null in %s on line %d
NULL
Warning: Trying to access array offset on value of type null in %s on line %d
-Warning: Trying to get property 'b' of non-object in %s on line %d
+Warning: Attempt to read property 'b' on null in %s on line %d
NULL
Warning: Trying to access array offset on value of type null in %s on line %d
-Warning: Trying to get property '' of non-object in %s on line %d
+Warning: Attempt to read property '' on string in %s on line %d
bool(false)
bool(true)
bool(false)
--EXPECTF--
string(1) "f"
-Warning: Trying to get property 'prop' of non-object in %s on line %d
+Warning: Attempt to read property 'prop' on string in %s on line %d
NULL
Call to a member function method() on string
int(42)
--EXPECTF--
string(1) "t"
-Warning: Trying to get property 'prop' of non-object in %s on line %d
+Warning: Attempt to read property 'prop' on string in %s on line %d
NULL
Call to a member function method() on string
?>
--EXPECTF--
-Warning: Trying to get property 'bar' of non-object in %s on line %d
+Warning: Attempt to read property 'bar' on string in %s on line %d
ZEND_API const char *zend_zval_type_name(const zval *arg) /* {{{ */
{
ZVAL_DEREF(arg);
- return zend_get_type_by_const(Z_TYPE_P(arg));
+
+ return Z_ISUNDEF_P(arg) ? "null" : zend_get_type_by_const(Z_TYPE_P(arg));
}
/* }}} */
|| opline->opcode == ZEND_POST_INC_OBJ
|| opline->opcode == ZEND_POST_DEC_OBJ) {
zend_throw_error(NULL,
- "Attempt to increment/decrement property '%s' of non-object",
- ZSTR_VAL(property_name));
+ "Attempt to increment/decrement property '%s' on %s",
+ ZSTR_VAL(property_name), zend_zval_type_name(object)
+ );
} else if (opline->opcode == ZEND_FETCH_OBJ_W
|| opline->opcode == ZEND_FETCH_OBJ_RW
|| opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG
|| opline->opcode == ZEND_ASSIGN_OBJ_REF) {
zend_throw_error(NULL,
- "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
+ "Attempt to modify property '%s' on %s",
+ ZSTR_VAL(property_name), zend_zval_type_name(object)
+ );
} else {
zend_throw_error(NULL,
- "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
+ "Attempt to assign property '%s' on %s",
+ ZSTR_VAL(property_name), zend_zval_type_name(object)
+ );
}
zend_tmp_string_release(tmp_property_name);
zend_throw_error(NULL, "%s", msg);
}
-static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_read(zval *property)
+static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_read(zval *object, zval *property)
{
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
- zend_error(E_WARNING, "Trying to get property '%s' of non-object", ZSTR_VAL(property_name));
+ zend_error(E_WARNING, "Attempt to read property '%s' on %s", ZSTR_VAL(property_name), zend_zval_type_name(object));
zend_tmp_string_release(tmp_property_name);
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
ZEND_VM_C_GOTO(fetch_obj_r_finish);
} while (0);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_wrong_property_read(offset);
+ zend_wrong_property_read(container, offset);
ZVAL_NULL(EX_VAR(opline->result.var));
goto fetch_obj_r_finish;
} while (0);
?>
--EXPECT--
-Attempt to assign property 'nodeValue' of non-object
-Attempt to assign property 'nodeValue' of non-object
+Attempt to assign property 'nodeValue' on null
+Attempt to assign property 'nodeValue' on null
Array
(
[0] => Value
testing property access
string(4) "data"
-Warning: Trying to get property 'textContent' of non-object in %s on line %d
+Warning: Attempt to read property 'textContent' on null in %s on line %d
NULL
testing offset not a long
array(1) {
string(4) "test"
}
-Warning: Trying to get property 'textContent' of non-object in %s on line %d
+Warning: Attempt to read property 'textContent' on null in %s on line %d
bool(false)
NULL
array(1) {
Warning: DOMDocument::loadXML(): Entity 'file' not defined in Entity, line: 4 in %s on line %d
-Warning: Trying to get property 'firstChild' of non-object in %s on line %d
+Warning: Attempt to read property 'firstChild' on null in %s on line %d
-Warning: Trying to get property 'nodeValue' of non-object in %s on line %d
+Warning: Attempt to read property 'nodeValue' on null in %s on line %d
REGISTER_HELPER(zend_jit_assign_op_to_typed_ref);
REGISTER_HELPER(zend_jit_only_vars_by_reference);
REGISTER_HELPER(zend_jit_invalid_array_access);
+ REGISTER_HELPER(zend_jit_invalid_property_read);
REGISTER_HELPER(zend_jit_prepare_assign_dim_ref);
REGISTER_HELPER(zend_jit_pre_inc);
REGISTER_HELPER(zend_jit_pre_dec);
static void ZEND_FASTCALL zend_jit_invalid_array_access(zval *container)
{
- const char *type = Z_ISUNDEF_P(container) ? "null" : zend_zval_type_name(container);
- zend_error(E_WARNING, "Trying to access array offset on value of type %s", type);
+ zend_error(E_WARNING, "Trying to access array offset on value of type %s", zend_zval_type_name(container));
+}
+
+static void ZEND_FASTCALL zend_jit_invalid_property_read(zval *container, const char *property_name)
+{
+ zend_error(E_WARNING, "Attempt to read property '%s' on %s", property_name, zend_zval_type_name(container));
}
static zval * ZEND_FASTCALL zend_jit_prepare_assign_dim_ref(zval *ref) {
zval *member;
uint32_t offset;
zend_bool may_be_dynamic = 1;
- zend_jit_addr op1_addr = 0;
+ zend_jit_addr op1_addr = 0, orig_op1_addr = 0;
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
zend_jit_addr this_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, offsetof(zend_execute_data, This));
zend_jit_addr prop_addr;
if (opline->op1_type == IS_UNUSED) {
| GET_ZVAL_PTR FCARG1a, this_addr
} else {
- op1_addr = OP1_ADDR();
+ op1_addr = orig_op1_addr = OP1_ADDR();
if (op1_info & MAY_BE_REF) {
| LOAD_ZVAL_ADDR r0, op1_addr
| ZVAL_DEREF r0, op1_info
| EXT_CALL zend_jit_undefined_op_helper, r0
|1:
}
- |.if X64
- | mov CARG1, E_WARNING
- | LOAD_ADDR CARG2, "Trying to get property '%s' of non-object"
- | LOAD_ADDR CARG3, Z_STRVAL_P(member)
- | EXT_CALL zend_error, r0
- |.else
- | sub r4, 4
- | push Z_STRVAL_P(member)
- | push "Trying to get property '%s' of non-object"
- | push E_WARNING
- | EXT_CALL zend_error, r0
- | add r4, 16
- |.endif
+ | LOAD_ZVAL_ADDR FCARG1a, orig_op1_addr
+ | LOAD_ADDR FCARG2a, Z_STRVAL_P(member)
+ | EXT_CALL zend_jit_invalid_property_read, r0
}
| SET_ZVAL_TYPE_INFO res_addr, IS_NULL
| jmp >9
?>
--EXPECTF--
Notice: Undefined offset: 0 in %s on line %d
-Attempt to assign property 'y' of non-object
+Attempt to assign property 'y' on null
array(0) {
}
}
-Attempt to modify property 'abc' of non-object
+Attempt to modify property 'abc' on array
array(0) {
}
-Attempt to modify property 'abc' of non-object
+Attempt to modify property 'abc' on null
NULL
-Attempt to modify property 'abc' of non-object
+Attempt to modify property 'abc' on string
string(0) ""
string(19) "SELECT id FROM test"
----------------------------------
-Warning: Trying to get property 'queryString' of non-object in %s on line %d
+Warning: Attempt to read property 'queryString' on bool in %s on line %d
NULL