This removes object auto-vivification support.
This also means that we can remove the corresponding special
handling for typed properites: We no longer need to check that a
property is convertible to stdClass if such a conversion might
take place indirectly due to a nested property write.
Additionally OBJ_W style operations now no longer modify the
object operand, and as such we no longer need to treat op1 as a
def in SSA form.
The next step would be to actually compile the whole LHS of OBJ_W
operations in R rather than W mode, but that causes issues with
SimpleXML, whose object handlers depend on the current compilation
structure.
Part of https://wiki.php.net/rfc/engine_warnings.
function test(?int $arg = CONST_RESOLVING_TO_NULL) {}
// Or
function test(int $arg = null) {}
+ . Attempting to write to a property of a non-object will now result in an
+ Error exception. Previously this resulted in a warning and either converted
+ the value into an object (if it was null, false or an empty string) or
+ ignored the write altogether (in all other cases).
+ RFC: Part of https://wiki.php.net/rfc/engine_warnings
- COM:
. Removed the ability to import case-insensitive constants from type
$test->a()->a;
print "ok\n";
-$test->a()->a = 1;
+try {
+ $test->a()->a = 1;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
print "ok\n";
?>
--EXPECTF--
Notice: Trying to get property 'a' of non-object in %s on line %d
ok
-
-Warning: Creating default object from empty value in %s on line %d
+Attempt to assign property 'a' of non-object
ok
$arr[1][2][3][4][5]->foo;
-$arr[1][2][3][4][5]->foo = 1;
+try {
+ $arr[1][2][3][4][5]->foo = 1;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
$arr[][] = 2;
-$arr[][]->bar = 2;
+try {
+ $arr[][]->bar = 2;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
?>
--EXPECTF--
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to get property 'foo' of non-object in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
+Attempt to assign property 'foo' of non-object
+Attempt to assign property 'bar' of non-object
var_dump($array[new stdClass] += 123);
var_dump($true[123] += 456);
- var_dump($true->foo = 123);
- var_dump($true->foo += 123);
+ try {
+ var_dump($true->foo = 123);
+ } catch (Error $e) {
+ echo $e->getMessage(), "\n";
+ }
+ try {
+ var_dump($true->foo += 123);
+ } catch (Error $e) {
+ echo $e->getMessage(), "\n";
+ }
}
test();
Warning: Cannot use a scalar value as an array in %s on line %d
NULL
-
-Warning: Attempt to assign property 'foo' of non-object in %s on line %d
-NULL
-
-Warning: Attempt to assign property 'foo' of non-object in %s on line %d
-NULL
+Attempt to assign property 'foo' of non-object
+Attempt to assign property 'foo' of non-object
return 42;
}
-$str = "foo";
$var = 24;
-var_dump($str->foo =& $var);
-var_dump($str);
-var_dump($str->foo =& val());
-var_dump($str);
+$arr = [PHP_INT_MAX => "foo"];
+var_dump($arr[] =& $var);
+var_dump(count($arr));
+var_dump($arr[] =& val());
+var_dump(count($arr));
?>
--EXPECTF--
-Warning: Attempt to modify property 'foo' of non-object in %s on line %d
+Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
NULL
-string(3) "foo"
+int(1)
-Warning: Attempt to modify property 'foo' of non-object in %s on line %d
+Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
NULL
-string(3) "foo"
+int(1)
Bug #36303 (foreach on error_zval produces segfault)
--FILE--
<?php
-$x="test";
-foreach($x->a->b as &$v) {
+$x=[PHP_INT_MAX=>"test"];
+foreach ($x[] as &$v) {
}
echo "ok\n";
?>
--EXPECTF--
-Warning: Attempt to modify property 'a' of non-object in %sbug36303.php on line 3
+Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
-Warning: Invalid argument supplied for foreach() in %sbug36303.php on line 3
+Warning: Invalid argument supplied for foreach() in %s on line %d
ok
+++ /dev/null
---TEST--
-Bug #41075 (memleak when creating default object caused exception)
---FILE--
-<?php
-
-function err($errno, $errstr, $errfile, $errline)
-{
- throw new Exception($errstr);
-}
-
-set_error_handler("err");
-
-class test {
- function foo() {
- $var = $this->blah->prop = "string";
- var_dump($this->blah);
- }
-}
-
-$t = new test;
-try {
- $t->foo();
-} catch (Exception $e) {
- var_dump($e->getMessage());
-}
-
-echo "Done\n";
-?>
---EXPECT--
-string(40) "Creating default object from empty value"
-Done
echo "--> read access: ";
echo $a->p;
-echo "\n--> direct assignment: ";
-$a->p = $s;
+echo "\n--> direct assignment:\n";
+try {
+ $a->p = $s;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
-echo "\n--> increment: ";
-$a->p++;
+echo "\n--> increment:\n";
+try {
+ $a->p++;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
-echo "\n--> reference assignment:";
-$a->p =& $s;
+echo "\n--> reference assignment:\n";
+try {
+ $a->p =& $s;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
-echo "\n--> reference assignment:";
-$s =& $a->p;
+echo "\n--> reference assignment:\n";
+try {
+ $s =& $a->p;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
-echo "\n--> indexed assignment:";
-$a->p[0] = $s;
+echo "\n--> indexed assignment:\n";
+try {
+ $a->p[0] = $s;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
echo "\n--> Confirm assignments have had no impact:\n";
var_dump($a);
?>
--EXPECTF--
--> read access:
-Notice: Trying to get property 'p' of non-object in %sbug44660.php on line 6
+Notice: Trying to get property 'p' of non-object in %s on line %d
---> direct assignment:
-Warning: Attempt to assign property 'p' of non-object in %sbug44660.php on line 9
+--> direct assignment:
+Attempt to assign property 'p' of non-object
---> increment:
-Warning: Attempt to increment/decrement property 'p' of non-object in %sbug44660.php on line 12
+--> increment:
+Attempt to increment/decrement property 'p' of non-object
--> reference assignment:
-Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 15
+Attempt to modify property 'p' of non-object
--> reference assignment:
-Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 18
+Attempt to modify property 'p' of non-object
--> indexed assignment:
-Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 21
+Attempt to modify property 'p' of non-object
--> Confirm assignments have had no impact:
bool(true)
+++ /dev/null
---TEST--
-Bug #48004 (Error handler prevents creation of default object)
---FILE--
-<?php
-function error_handler($errno, $errstr, $errfile, $errline) {
- return true;
-}
-
-function test() {
- $data->id = 1;
- print_r($data);
-}
-
-set_error_handler("error_handler");
-test();
-?>
---EXPECT--
-stdClass Object
-(
- [id] => 1
-)
return $x;
}
-foo()->a = 1;
-foo()->a->b = 2;
-foo()->a++;
-foo()->a->b++;
-foo()->a += 2;
-foo()->a->b += 2;
+try {
+ foo()->a = 1;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ foo()->a->b = 2;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ foo()->a++;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ foo()->a->b++;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ foo()->a += 2;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ foo()->a->b += 2;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
foo()[0] = 1;
foo()[0][0] = 2;
var_dump(foo());
?>
--EXPECTF--
-Notice: Undefined variable: x in %sbug52041.php on line 3
-
-Warning: Creating default object from empty value in %sbug52041.php on line 6
-
-Notice: Undefined variable: x in %sbug52041.php on line 3
-
-Warning: Creating default object from empty value in %sbug52041.php on line 7
-
-Warning: Creating default object from empty value in %sbug52041.php on line 7
-
-Notice: Undefined variable: x in %sbug52041.php on line 3
-
-Warning: Creating default object from empty value in %sbug52041.php on line 8
-
-Notice: Undefined property: stdClass::$a in %sbug52041.php on line 8
-
-Notice: Undefined variable: x in %sbug52041.php on line 3
-
-Warning: Creating default object from empty value in %sbug52041.php on line 9
-
-Notice: Undefined property: stdClass::$a in %sbug52041.php on line 9
-
-Warning: Creating default object from empty value in %sbug52041.php on line 9
-
-Notice: Undefined property: stdClass::$b in %sbug52041.php on line 9
-
-Notice: Undefined variable: x in %sbug52041.php on line 3
-
-Warning: Creating default object from empty value in %sbug52041.php on line 10
-
-Notice: Undefined property: stdClass::$a in %sbug52041.php on line 10
+Notice: Undefined variable: x in %s on line %d
+Attempt to assign property 'a' of non-object
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
+Attempt to modify property 'a' of non-object
-Warning: Creating default object from empty value in %sbug52041.php on line 11
+Notice: Undefined variable: x in %s on line %d
+Attempt to increment/decrement property 'a' of non-object
-Notice: Undefined property: stdClass::$a in %sbug52041.php on line 11
+Notice: Undefined variable: x in %s on line %d
+Attempt to modify property 'a' of non-object
-Warning: Creating default object from empty value in %sbug52041.php on line 11
+Notice: Undefined variable: x in %s on line %d
+Attempt to assign property 'a' of non-object
-Notice: Undefined property: stdClass::$b in %sbug52041.php on line 11
+Notice: Undefined variable: x in %s on line %d
+Attempt to modify property 'a' of non-object
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
-Notice: Undefined offset: 0 in %sbug52041.php on line 15
+Notice: Undefined offset: 0 in %s on line %d
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
-Notice: Undefined offset: 0 in %sbug52041.php on line 16
+Notice: Undefined offset: 0 in %s on line %d
-Notice: Undefined offset: 0 in %sbug52041.php on line 16
+Notice: Undefined offset: 0 in %s on line %d
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
-Notice: Undefined offset: 0 in %sbug52041.php on line 17
+Notice: Undefined offset: 0 in %s on line %d
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
-Notice: Undefined offset: 0 in %sbug52041.php on line 18
+Notice: Undefined offset: 0 in %s on line %d
-Notice: Undefined offset: 0 in %sbug52041.php on line 18
+Notice: Undefined offset: 0 in %s on line %d
-Notice: Undefined variable: x in %sbug52041.php on line 3
+Notice: Undefined variable: x in %s on line %d
NULL
Bug #52237 (Crash when passing the reference of the property of a non-object)
--FILE--
<?php
-$data = 'test';
-preg_match('//', '', $data->info);
-var_dump($data);
+$data = [PHP_INT_MAX => 'test'];
+preg_match('//', '', $data[]);
+var_dump(count($data));
?>
--EXPECTF--
-Warning: Attempt to modify property 'info' of non-object in %sbug52237.php on line 3
-string(4) "test"
+Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
+int(1)
$foo->f3()[0] = 1;
var_dump($foo->a3);
-$foo->f4()->a = 1;
+try {
+ $foo->f4()->a = 1;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($foo->o1);
$foo->f5()->a = 1;
var_dump($foo->a1[0]);
$foo->f6()[0]++;
var_dump($foo->a1[0]);
---EXPECTF--
+--EXPECT--
NULL
array(0) {
}
array(0) {
}
-
-Warning: Creating default object from empty value in %sbug52614.php on line 52
+Attempt to assign property 'a' of non-object
NULL
-object(stdClass)#%d (1) {
+object(stdClass)#3 (1) {
["a"]=>
int(1)
}
+++ /dev/null
---TEST--
-Bug #54262 (Crash when assigning value to a dimension in a non-array)
---FILE--
-<?php
-$a = '0';
-var_dump(isset($a['b']));
-$simpleString = preg_match('//', '', $a->a);
-$simpleString["wrong"] = "f";
-echo "ok\n";
-?>
---EXPECTF--
-bool(false)
-
-Warning: Attempt to modify property 'a' of non-object in %sbug54262.php on line 4
-
-Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5
-ok
+++ /dev/null
---TEST--
-Bug #54265 (crash when variable gets reassigned in error handler)
---FILE--
-<?php
-function my_errorhandler($errno,$errormsg) {
- global $my_var;
- $my_var = 0;
- echo "EROOR: $errormsg\n";
-}
-set_error_handler("my_errorhandler");
-$my_var = str_repeat("A",$my_var[0]->errormsg = "xyz");
-echo "ok\n";
-?>
---EXPECT--
-EROOR: Creating default object from empty value
-ok
+++ /dev/null
---TEST--
-Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
---FILE--
-<?php
-function add_points($player, $points) {
- $player->energy += $points;
- print_r($player);
-}
-add_points(NULL, 2);
---EXPECTF--
-Warning: Creating default object from empty value in %sbug62005.php on line %d
-
-Notice: Undefined property: stdClass::$energy in %sbug62005.php on line 3
-stdClass Object
-(
- [energy] => 2
-)
--FILE--
<?php
$array = [];
-$array['']->prop =& $array[0];
+$array[''][0] =& $array[0];
$array[0] = 42;
var_dump($array);
?>
---EXPECTF--
-Warning: Creating default object from empty value in %sbug71539_5.php on line 3
+--EXPECT--
array(2) {
[0]=>
&int(42)
[""]=>
- object(stdClass)#1 (1) {
- ["prop"]=>
+ array(1) {
+ [0]=>
&int(42)
}
}
+++ /dev/null
---TEST--
-Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
---FILE--
-<?php
-
-$a = 0;
-
-$b = $a->b->i -= 0;
-
-var_dump($b);
-
-?>
---EXPECTF--
-Warning: Attempt to modify property 'b' of non-object in %sbug72911.php on line %d
-NULL
error_reporting=0
--FILE--
<?php
-$$A += $$B->a = &$$C;
+$$A += $$B['a'] = &$$C;
unset($$A);
-$$A -= $$B->a = &$$C;
+try {
+ $$A -= $$B['a'] = &$$C;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
unset($$A);
-$$A *= $$B->a = &$$C;
+try {
+ $$A *= $$B['a'] = &$$C;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
unset($$A);
-$$A /= $$B->a = &$$C;
+try {
+ $$A /= $$B['a'] = &$$C;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
unset($$A);
-$$A **= $$B->a = &$$C;
+$$A **= $$B['a'] = &$$C;
var_dump($$A);
?>
--EXPECT--
-int(1)
+Unsupported operand types
+Unsupported operand types
+Unsupported operand types
+int(0)
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
--FILE--
<?php
-function eh(){}
-
-set_error_handler('eh');
$d->d = &$d + $d->d/=0;
var_dump($d);
?>
---EXPECT--
-float(INF)
+--EXPECTF--
+Fatal error: Uncaught Error: Attempt to modify property 'd' of non-object in %s:%d
+Stack trace:
+#0 {main}
+ thrown in %s on line %d
class A
{
var $_stdObject;
+ function __construct()
+ {
+ $this->_stdObject = new stdClass;
+ }
function &__get($property)
{
if (isset($this->_stdObject->{$property})) {
var_dump($b->settings);
?>
--EXPECTF--
-Warning: Creating default object from empty value in %sbug75573.php on line %d
-
-Notice: Only variable references should be returned by reference in %sbug75573.php on line %d
+Notice: Only variable references should be returned by reference in %s on line %d
string(3) "abc"
array(2) {
["foo"]=>
--FILE--
<?php
-$null->a = 42;
+try {
+ $null->a = 42;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($null);
unset($null);
-$null->a['hello'] = 42;
+try {
+ $null->a['hello'] = 42;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($null);
unset($null);
-$null->a->b = 42;
+try {
+ $null->a->b = 42;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($null);
unset($null);
-$null->a['hello']->b = 42;
+try {
+ $null->a['hello']->b = 42;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($null);
unset($null);
-$null->a->b['hello'] = 42;
+try {
+ $null->a->b['hello'] = 42;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($null);
unset($null);
?>
--EXPECTF--
-Warning: Creating default object from empty value in %sbug75921.php on line 3
-object(stdClass)#1 (1) {
- ["a"]=>
- int(42)
-}
+Attempt to assign property 'a' of non-object
-Warning: Creating default object from empty value in %sbug75921.php on line 7
-object(stdClass)#1 (1) {
- ["a"]=>
- array(1) {
- ["hello"]=>
- int(42)
- }
-}
-
-Warning: Creating default object from empty value in %sbug75921.php on line 11
-
-Warning: Creating default object from empty value in %sbug75921.php on line 11
-object(stdClass)#1 (1) {
- ["a"]=>
- object(stdClass)#2 (1) {
- ["b"]=>
- int(42)
- }
-}
+Notice: Undefined variable: null in %s on line %d
+NULL
+Attempt to modify property 'a' of non-object
-Warning: Creating default object from empty value in %sbug75921.php on line 15
+Notice: Undefined variable: null in %s on line %d
+NULL
+Attempt to modify property 'a' of non-object
-Warning: Creating default object from empty value in %sbug75921.php on line 15
-object(stdClass)#1 (1) {
- ["a"]=>
- array(1) {
- ["hello"]=>
- object(stdClass)#2 (1) {
- ["b"]=>
- int(42)
- }
- }
-}
+Notice: Undefined variable: null in %s on line %d
+NULL
+Attempt to modify property 'a' of non-object
-Warning: Creating default object from empty value in %sbug75921.php on line 19
+Notice: Undefined variable: null in %s on line %d
+NULL
+Attempt to modify property 'a' of non-object
-Warning: Creating default object from empty value in %sbug75921.php on line 19
-object(stdClass)#1 (1) {
- ["a"]=>
- object(stdClass)#2 (1) {
- ["b"]=>
- array(1) {
- ["hello"]=>
- int(42)
- }
- }
-}
+Notice: Undefined variable: null in %s on line %d
+NULL
<?php
$varName = 'var';
$propName = 'prop';
-$$varName->$propName =& $$varName;
+try {
+ $$varName->$propName =& $$varName;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
var_dump($var);
?>
---EXPECTF--
-Warning: Creating default object from empty value in %s on line %d
-object(stdClass)#1 (1) {
- ["prop"]=>
- *RECURSION*
-}
+--EXPECT--
+Attempt to modify property 'prop' of non-object
+NULL
Bug #78531 (Crash when using undefined variable as object)
--FILE--
<?php
-@$u1->a += 5;
-var_dump($u1->a);
-@$x = ++$u2->a;
-var_dump($u2->a);
-@$x = $u3->a++;
-var_dump($u3->a);
-@$u4->a->a += 5;
-var_dump($u4->a->a);
+try {
+ $u1->a += 5;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ $x = ++$u2->a;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ $x = $u3->a++;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ $u4->a->a += 5;
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
?>
---EXPECT--
-int(5)
-int(1)
-int(1)
-int(5)
\ No newline at end of file
+--EXPECTF--
+Notice: Undefined variable: u1 in %s on line %d
+Attempt to assign property 'a' of non-object
+
+Notice: Undefined variable: u2 in %s on line %d
+Attempt to increment/decrement property 'a' of non-object
+
+Notice: Undefined variable: u3 in %s on line %d
+Attempt to increment/decrement property 'a' of non-object
+
+Notice: Undefined variable: u4 in %s on line %d
+Attempt to modify property 'a' of non-object
+++ /dev/null
---TEST--
-Accessing members of standard object through of variable variable
---FILE--
-<?php
-
-error_reporting(E_ALL);
-
-$test = 'stdclass';
-
-$$test->a =& $$test;
-$$test->a->b[] = 2;
-
-var_dump($$test);
-
-?>
---EXPECTF--
-Warning: Creating default object from empty value in %sobjects_020.php on line 7
-object(stdClass)#%d (2) {
- ["a"]=>
- *RECURSION*
- ["b"]=>
- array(1) {
- [0]=>
- int(2)
- }
-}
+++ /dev/null
---TEST--
-Automatic promotion of falsy to object
---FILE--
-<?php
-
-class Test {
- public ?Test $prop;
- public ?stdClass $stdProp;
- public ?object $objectProp;
-
- public static ?Test $staticProp = null;
- public static ?stdClass $staticStdProp = null;
- public static ?object $staticObjectProp = null;
-}
-
-// Object properties
-$test = new Test;
-try {
- $test->prop->wat = 123;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-$test->stdProp->wat = 123;
-$test->objectProp->wat = 123;
-var_dump($test);
-
-// Object properties via reference
-$test = new Test;
-$prop =& $test->prop;
-$stdProp =& $test->stdProp;
-$objectProp =& $test->objectProp;
-try {
- $prop->wat = 123;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-$stdProp->wat = 123;
-$objectProp->wat = 123;
-var_dump($test);
-
-// Object properties via reference rw
-$test = new Test;
-$prop =& $test->prop;
-$stdProp =& $test->stdProp;
-$objectProp =& $test->objectProp;
-try {
- $prop->wat->wat = 123;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-$stdProp->wat->wat = 123;
-$objectProp->wat->wat = 123;
-var_dump($test);
-
-// Static properties
-try {
- Test::$staticProp->wat = 123;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-Test::$staticStdProp->wat = 123;
-Test::$staticObjectProp->wat = 123;
-var_dump(Test::$staticProp, Test::$staticStdProp, Test::$staticObjectProp);
-
-// Non-string property name
-$test = new Test;
-$propName = new class {
- public function __toString() {
- return 'prop';
- }
-};
-try {
- $test->$propName->wat = 123;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-var_dump($test);
-
-// Initially null
-$test = new Test;
-$test->prop = NULL;
-$test->stdProp = NULL;
-$test->objectProp = NULL;
-try {
- $test->prop->wat = 123;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-$test->stdProp->wat = 123;
-$test->objectProp->wat = 123;
-var_dump($test);
-
-?>
---EXPECTF--
-Cannot auto-initialize an stdClass inside property Test::$prop of type ?Test
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-object(Test)#1 (2) {
- ["prop"]=>
- uninitialized(?Test)
- ["stdProp"]=>
- object(stdClass)#3 (1) {
- ["wat"]=>
- int(123)
- }
- ["objectProp"]=>
- object(stdClass)#4 (1) {
- ["wat"]=>
- int(123)
- }
-}
-Cannot auto-initialize an stdClass inside a reference held by property Test::$prop of type ?Test
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-object(Test)#5 (3) {
- ["prop"]=>
- &NULL
- ["stdProp"]=>
- &object(stdClass)#2 (1) {
- ["wat"]=>
- int(123)
- }
- ["objectProp"]=>
- &object(stdClass)#4 (1) {
- ["wat"]=>
- int(123)
- }
-}
-Cannot auto-initialize an stdClass inside a reference held by property Test::$prop of type ?Test
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-object(Test)#3 (3) {
- ["prop"]=>
- &NULL
- ["stdProp"]=>
- &object(stdClass)#1 (1) {
- ["wat"]=>
- object(stdClass)#2 (1) {
- ["wat"]=>
- int(123)
- }
- }
- ["objectProp"]=>
- &object(stdClass)#5 (1) {
- ["wat"]=>
- object(stdClass)#6 (1) {
- ["wat"]=>
- int(123)
- }
- }
-}
-Cannot auto-initialize an stdClass inside property Test::$staticProp of type ?Test
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-NULL
-object(stdClass)#4 (1) {
- ["wat"]=>
- int(123)
-}
-object(stdClass)#8 (1) {
- ["wat"]=>
- int(123)
-}
-Cannot auto-initialize an stdClass inside property Test::$prop of type ?Test
-object(Test)#9 (0) {
- ["prop"]=>
- uninitialized(?Test)
- ["stdProp"]=>
- uninitialized(?stdClass)
- ["objectProp"]=>
- uninitialized(?object)
-}
-Cannot auto-initialize an stdClass inside property Test::$prop of type ?Test
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-object(Test)#7 (3) {
- ["prop"]=>
- NULL
- ["stdProp"]=>
- object(stdClass)#10 (1) {
- ["wat"]=>
- int(123)
- }
- ["objectProp"]=>
- object(stdClass)#11 (1) {
- ["wat"]=>
- int(123)
- }
-}
CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS;
} else {
opline = zend_delayed_compile_var(&obj_node, obj_ast, type, 0);
- if (opline && type == BP_VAR_W && (opline->opcode == ZEND_FETCH_STATIC_PROP_W || opline->opcode == ZEND_FETCH_OBJ_W)) {
- opline->extended_value |= ZEND_FETCH_OBJ_WRITE;
- }
-
zend_separate_if_call_and_write(&obj_node, obj_ast, type);
}
zend_compile_expr(&prop_node, prop_ast);
/* Only one of these can ever be in use */
#define ZEND_FETCH_REF 1
#define ZEND_FETCH_DIM_WRITE 2
-#define ZEND_FETCH_OBJ_WRITE 3
#define ZEND_FETCH_OBJ_FLAGS 3
#define ZEND_ISEMPTY (1<<0)
zend_get_unmangled_property_name(prop->name));
}
-static zend_never_inline zend_bool zend_verify_ref_stdClass_assignable(zend_reference *ref);
static zend_never_inline zend_bool zend_verify_ref_array_assignable(zend_reference *ref);
/* this should modify object only if it's empty */
-static zend_never_inline ZEND_COLD zval* ZEND_FASTCALL make_real_object(zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC)
-{
- zend_object *obj;
- zval *ref = NULL;
- if (Z_ISREF_P(object)) {
- ref = object;
- object = Z_REFVAL_P(object);
- }
-
- if (UNEXPECTED(Z_TYPE_P(object) > IS_FALSE &&
- (Z_TYPE_P(object) != IS_STRING || Z_STRLEN_P(object) != 0))) {
- if (opline->op1_type != IS_VAR || EXPECTED(!Z_ISERROR_P(object))) {
- zend_string *tmp_property_name;
- zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
-
- if (opline->opcode == ZEND_PRE_INC_OBJ
- || opline->opcode == ZEND_PRE_DEC_OBJ
- || opline->opcode == ZEND_POST_INC_OBJ
- || opline->opcode == ZEND_POST_DEC_OBJ) {
- zend_error(E_WARNING, "Attempt to increment/decrement property '%s' of non-object", ZSTR_VAL(property_name));
- } 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_error(E_WARNING, "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
- } else {
- zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
- }
- zend_tmp_string_release(tmp_property_name);
- }
- if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- return NULL;
- }
-
- if (ref && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(ref))) {
- if (UNEXPECTED(!zend_verify_ref_stdClass_assignable(Z_REF_P(ref)))) {
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_UNDEF(EX_VAR(opline->result.var));
- }
- return NULL;
+static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_error(zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC)
+{
+ /* TODO: What about the ERROR case? */
+ if (EXPECTED(!Z_ISERROR_P(object))) {
+ zend_string *tmp_property_name;
+ zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
+
+ if (opline->opcode == ZEND_PRE_INC_OBJ
+ || opline->opcode == ZEND_PRE_DEC_OBJ
+ || 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));
+ } 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));
+ } else {
+ zend_throw_error(NULL,
+ "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
}
+ zend_tmp_string_release(tmp_property_name);
}
- zval_ptr_dtor_nogc(object);
- object_init(object);
- obj = Z_OBJ_P(object);
- GC_ADDREF(obj);
- zend_error(E_WARNING, "Creating default object from empty value");
- if (GC_REFCOUNT(obj) == 1) {
- /* the enclosing container was deleted, obj is unreferenced */
- OBJ_RELEASE(obj);
- if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- return NULL;
+ if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
}
- GC_DELREF(obj);
- return object;
}
static ZEND_COLD void zend_verify_type_error_common(
|| (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE);
}
-static zend_always_inline zend_bool promotes_to_object(zval *val) {
- ZVAL_DEREF(val);
- return Z_TYPE_P(val) <= IS_FALSE
- || (Z_TYPE_P(val) == IS_STRING && Z_STRLEN_P(val) == 0);
-}
-
static zend_always_inline zend_bool check_type_array_assignable(zend_type type) {
if (!ZEND_TYPE_IS_SET(type)) {
return 1;
return ZEND_TYPE_IS_MASK(type) && (ZEND_TYPE_MASK(type) & (MAY_BE_ITERABLE|MAY_BE_ARRAY));
}
-static zend_always_inline zend_bool check_type_stdClass_assignable(zend_type type) {
- if (!ZEND_TYPE_IS_SET(type)) {
- return 1;
- }
- if (ZEND_TYPE_IS_CLASS(type)) {
- if (ZEND_TYPE_IS_CE(type)) {
- return ZEND_TYPE_CE(type) == zend_standard_class_def;
- } else {
- return zend_string_equals_literal_ci(ZEND_TYPE_NAME(type), "stdclass");
- }
- } else {
- return (ZEND_TYPE_MASK(type) & MAY_BE_OBJECT) != 0;
- }
-}
-
/* Checks whether an array can be assigned to the reference. Returns conflicting property if
* assignment is not possible, NULL otherwise. */
static zend_never_inline zend_bool zend_verify_ref_array_assignable(zend_reference *ref) {
return 1;
}
-/* Checks whether an stdClass can be assigned to the reference. Returns conflicting property if
- * assignment is not possible, NULL otherwise. */
-static zend_never_inline zend_bool zend_verify_ref_stdClass_assignable(zend_reference *ref) {
- zend_property_info *prop;
- ZEND_ASSERT(ZEND_REF_HAS_TYPE_SOURCES(ref));
- ZEND_REF_FOREACH_TYPE_SOURCES(ref, prop) {
- if (!check_type_stdClass_assignable(prop->type)) {
- zend_throw_auto_init_in_ref_error(prop, "stdClass");
- return 0;
- }
- } ZEND_REF_FOREACH_TYPE_SOURCES_END();
- return 1;
-}
-
static zend_property_info *zend_object_fetch_property_type_info(
zend_object *obj, zval *slot)
{
}
}
break;
- case ZEND_FETCH_OBJ_WRITE:
- if (promotes_to_object(ptr)) {
- if (!prop_info) {
- prop_info = zend_object_fetch_property_type_info(obj, ptr);
- if (!prop_info) {
- break;
- }
- }
- if (!check_type_stdClass_assignable(prop_info->type)) {
- zend_throw_auto_init_in_prop_error(prop_info, "stdClass");
- if (result) ZVAL_ERROR(result);
- return 0;
- }
- }
- break;
case ZEND_FETCH_REF:
if (Z_TYPE_P(ptr) != IS_REFERENCE) {
if (!prop_info) {
return;
}
- container = make_real_object(container, prop_ptr OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!container)) {
- ZVAL_ERROR(result);
- return;
- }
+ zend_throw_non_object_error(container, prop_ptr OPLINE_CC EXECUTE_DATA_CC);
+ ZVAL_ERROR(result);
+ return;
} while (0);
}
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
ZEND_VM_C_LABEL(assign_op_object):
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
ZEND_VM_C_LABEL(pre_incdec_object):
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
ZEND_VM_C_LABEL(post_incdec_object):
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
-ZEND_VM_HANDLER(174, ZEND_FETCH_STATIC_PROP_W, ANY, CLASS_FETCH, FETCH_REF|DIM_OBJ_WRITE|CACHE_SLOT)
+ZEND_VM_HANDLER(174, ZEND_FETCH_STATIC_PROP_W, ANY, CLASS_FETCH, FETCH_REF|DIM_WRITE|CACHE_SLOT)
{
ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, BP_VAR_W);
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH_REF|DIM_OBJ_WRITE|CACHE_SLOT)
+ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH_REF|DIM_WRITE|CACHE_SLOT)
{
USE_OPLINE
zval *property, *container, *result;
object = Z_REFVAL_P(object);
ZEND_VM_C_GOTO(assign_object);
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- ZEND_VM_C_GOTO(free_and_exit_assign_obj);
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ ZEND_VM_C_GOTO(free_and_exit_assign_obj);
}
ZEND_VM_C_LABEL(assign_object):
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
assign_op_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
pre_incdec_object:
&& UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1();
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- break;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ break;
}
post_incdec_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
object = Z_REFVAL_P(object);
goto assign_object;
}
- object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
- if (UNEXPECTED(!object)) {
- value = &EG(uninitialized_zval);
- goto free_and_exit_assign_obj;
- }
+ zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC);
+ value = &EG(uninitialized_zval);
+ goto free_and_exit_assign_obj;
}
assign_object:
"ZEND_VM_EXT_ARRAY_INIT" => 1<<19,
"ZEND_VM_EXT_REF" => 1<<20,
"ZEND_VM_EXT_FETCH_REF" => 1<<21,
- "ZEND_VM_EXT_DIM_OBJ_WRITE" => 1<<22,
+ "ZEND_VM_EXT_DIM_WRITE" => 1<<22,
"ZEND_VM_EXT_MASK" => 0x0f000000,
"ZEND_VM_EXT_NUM" => 0x01000000,
"ZEND_VM_EXT_LAST_CATCH" => 0x02000000,
"FETCH_REF" => ZEND_VM_EXT_FETCH_REF,
"SRC" => ZEND_VM_EXT_SRC,
"CACHE_SLOT" => ZEND_VM_EXT_CACHE_SLOT,
- "DIM_OBJ_WRITE" => ZEND_VM_EXT_DIM_OBJ_WRITE,
+ "DIM_WRITE" => ZEND_VM_EXT_DIM_WRITE,
);
$vm_kind_name = array(
#define ZEND_VM_EXT_ARRAY_INIT 0x00080000
#define ZEND_VM_EXT_REF 0x00100000
#define ZEND_VM_EXT_FETCH_REF 0x00200000
-#define ZEND_VM_EXT_DIM_OBJ_WRITE 0x00400000
+#define ZEND_VM_EXT_DIM_WRITE 0x00400000
#define ZEND_VM_EXT_MASK 0x0f000000
#define ZEND_VM_EXT_NUM 0x01000000
#define ZEND_VM_EXT_LAST_CATCH 0x02000000
$elements = $dom->getElementsByTagName('i');
foreach ($elements as $i) {
- $i->previousSibling->nodeValue = '';
+ try {
+ $i->previousSibling->nodeValue = '';
+ } catch (Error $e) {
+ echo $e->getMessage(), "\n";
+ }
}
$arr = array();
print_r($arr);
?>
---EXPECTF--
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
+--EXPECT--
+Attempt to assign property 'nodeValue' of non-object
+Attempt to assign property 'nodeValue' of non-object
Array
(
[0] => Value
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
case ZEND_FETCH_DIM_UNSET:
- case ZEND_FETCH_OBJ_W:
- case ZEND_FETCH_OBJ_RW:
- case ZEND_FETCH_OBJ_FUNC_ARG:
- case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_LIST_W:
case ZEND_VERIFY_RETURN_TYPE:
case ZEND_PRE_INC_OBJ:
fprintf(stderr, " (ref)");
}
}
- if ((ZEND_VM_EXT_DIM_OBJ_WRITE|ZEND_VM_EXT_FETCH_REF) & flags) {
+ if ((ZEND_VM_EXT_DIM_WRITE|ZEND_VM_EXT_FETCH_REF) & flags) {
uint32_t obj_flags = opline->extended_value & ZEND_FETCH_OBJ_FLAGS;
if (obj_flags == ZEND_FETCH_REF) {
fprintf(stderr, " (ref)");
} else if (obj_flags == ZEND_FETCH_DIM_WRITE) {
fprintf(stderr, " (dim write)");
- } else if (obj_flags == ZEND_FETCH_OBJ_WRITE) {
- fprintf(stderr, " (obj write)");
}
}
}
case ZEND_FETCH_LIST_R:
case ZEND_FETCH_LIST_W:
if (ssa_ops[i].op1_def >= 0) {
+ uint32_t key_type = 0;
tmp = t1 & ~(MAY_BE_RC1|MAY_BE_RCN);
if (opline->opcode == ZEND_FETCH_DIM_W ||
opline->opcode == ZEND_FETCH_DIM_RW ||
tmp |= t1 & (MAY_BE_RC1|MAY_BE_RCN);
}
if (opline->op2_type == IS_UNUSED) {
- tmp |= MAY_BE_ARRAY_KEY_LONG;
+ key_type |= MAY_BE_ARRAY_KEY_LONG;
} else {
if (t2 & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) {
- tmp |= MAY_BE_ARRAY_KEY_LONG;
+ key_type |= MAY_BE_ARRAY_KEY_LONG;
}
if (t2 & MAY_BE_STRING) {
- tmp |= MAY_BE_ARRAY_KEY_STRING;
+ key_type |= MAY_BE_ARRAY_KEY_STRING;
if (opline->op2_type != IS_CONST) {
// FIXME: numeric string
- tmp |= MAY_BE_ARRAY_KEY_LONG;
+ key_type |= MAY_BE_ARRAY_KEY_LONG;
}
}
if (t2 & (MAY_BE_UNDEF | MAY_BE_NULL)) {
- tmp |= MAY_BE_ARRAY_KEY_STRING;
+ key_type |= MAY_BE_ARRAY_KEY_STRING;
}
}
} else if (opline->opcode == ZEND_FETCH_DIM_UNSET) {
case ZEND_FETCH_LIST_W:
case ZEND_ASSIGN_DIM:
case ZEND_ASSIGN_DIM_OP:
- tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
- break;
- case ZEND_FETCH_OBJ_W:
- case ZEND_FETCH_OBJ_RW:
- case ZEND_FETCH_OBJ_FUNC_ARG:
- case ZEND_ASSIGN_OBJ:
- case ZEND_ASSIGN_OBJ_OP:
- case ZEND_ASSIGN_OBJ_REF:
- case ZEND_PRE_INC_OBJ:
- case ZEND_PRE_DEC_OBJ:
- case ZEND_POST_INC_OBJ:
- case ZEND_POST_DEC_OBJ:
- tmp |= MAY_BE_ARRAY_OF_OBJECT;
+ tmp |= key_type | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
break;
case ZEND_SEND_VAR_EX:
case ZEND_SEND_FUNC_ARG:
case ZEND_VERIFY_RETURN_TYPE:
case ZEND_MAKE_REF:
case ZEND_FE_RESET_RW:
- tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
+ tmp |= key_type | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
break;
case ZEND_PRE_INC:
case ZEND_PRE_DEC:
case ZEND_POST_DEC:
if (tmp & MAY_BE_ARRAY_OF_LONG) {
/* may overflow */
- tmp |= MAY_BE_ARRAY_OF_DOUBLE;
+ tmp |= key_type | MAY_BE_ARRAY_OF_DOUBLE;
} else if (!(tmp & (MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE))) {
- tmp |= MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE;
+ tmp |= key_type | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE;
}
break;
+ case ZEND_FETCH_OBJ_W:
+ case ZEND_FETCH_OBJ_RW:
+ case ZEND_FETCH_OBJ_FUNC_ARG:
+ case ZEND_ASSIGN_OBJ:
+ case ZEND_ASSIGN_OBJ_OP:
+ case ZEND_ASSIGN_OBJ_REF:
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ /* These will result in an error exception, unless the element
+ * is already an object. */
+ break;
case ZEND_SEND_VAR:
/* This can occur if a DIM_FETCH_FUNC_ARG with UNUSED op2 is left
* behind, because it can't be converted to DIM_FETCH_R. */
case ZEND_FETCH_OBJ_W:
case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_OBJ_FUNC_ARG:
- if (ssa_ops[i].op1_def >= 0) {
- tmp = t1;
- if (opline->opcode == ZEND_FETCH_OBJ_W ||
- opline->opcode == ZEND_FETCH_OBJ_RW ||
- opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) {
- if (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) {
- if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
- tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
- tmp |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
- }
- }
- }
- UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
- COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
- }
if (ssa_ops[i].result_def >= 0) {
tmp = zend_fetch_prop_type(script,
zend_fetch_prop_info(op_array, ssa, opline, i), &ce);
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
case ZEND_FETCH_DIM_UNSET:
- case ZEND_FETCH_OBJ_W:
- case ZEND_FETCH_OBJ_RW:
- case ZEND_FETCH_OBJ_FUNC_ARG:
- case ZEND_FETCH_OBJ_UNSET:
case ZEND_FETCH_LIST_W:
if (opline->op1_type == IS_CV) {
ssa_ops[k].op1_def = ssa_vars_count;
$ary[0]->y += 2;
var_dump(is_object($ary[0]));
}
-test();
+try {
+ test();
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
?>
--EXPECTF--
Notice: Undefined offset: 0 in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-
-Notice: Undefined property: stdClass::$y in %s on line %d
-bool(true)
+Attempt to assign property 'y' of non-object
$a = $var;
}
+$obj = new stdClass;
foo($obj->a);
var_dump($obj);
foo2($obj->b);
var_dump($obj);
function bar() {
+ $obj = new stdClass;
foo($obj->a);
var_dump($obj);
foo2($obj->b);
var_dump($obj);
$d = array();
- foo($d->{"ab" ."c"});
+ try {
+ foo($d->{"ab" ."c"});
+ } catch (Error $err) {
+ echo $err->getMessage(), "\n";
+ }
var_dump($d);
$e = NULL;
- foo($e->{"ab" ."c"});
+ try {
+ foo($e->{"ab" ."c"});
+ } catch (Error $err) {
+ echo $err->getMessage(), "\n";
+ }
var_dump($e);
$f = "";
- foo($f->{"ab" ."c"});
+ try {
+ foo($f->{"ab" ."c"});
+ } catch (Error $err) {
+ echo $err->getMessage(), "\n";
+ }
var_dump($f);
}
bar();
?>
--EXPECTF--
-Warning: Creating default object from empty value in %s on line 14
object(stdClass)#%d (1) {
["a"]=>
int(2)
array(0) {
}
}
-
-Warning: Creating default object from empty value in %s on line 27
object(stdClass)#%d (1) {
["a"]=>
int(2)
array(0) {
}
}
-
-Warning: Attempt to modify property 'abc' of non-object in %sfetch_obj_001.php on line 40
+Attempt to modify property 'abc' of non-object
array(0) {
}
-
-Warning: Creating default object from empty value in %s on line 44
-object(stdClass)#%d (1) {
- ["abc"]=>
- int(2)
-}
-
-Warning: Creating default object from empty value in %s on line 48
-object(stdClass)#%d (1) {
- ["abc"]=>
- int(2)
-}
+Attempt to modify property 'abc' of non-object
+NULL
+Attempt to modify property 'abc' of non-object
+string(0) ""
* Alias to functions:
*/
-@$obj->p =& $obj;
+$obj = new stdClass;
+$obj->p =& $obj;
var_export($obj, true);
?>
===DONE===
--EXPECTF--
-Warning: var_export does not handle circular references in %s on line 9
+Warning: var_export does not handle circular references in %s on line 10
===DONE===
+++ /dev/null
---TEST--
-Implicit object instantiation when accessing properties of non-object.
---FILE--
-<?php
-class C {
- // These values get implicitly converted to objects
- public $boolFalse = false;
- public $emptyString = '';
- public $null = null;
-
- // These values do not get implicitly converted to objects
- public $boolTrue = true;
- public $nonEmptyString = 'hello';
- public $intZero = 0;
-}
-
-$c = new C;
-foreach($c as $name => $value) {
- echo "\n\n---( \$c->$name )---";
- echo "\n --> Attempting implicit conversion to object using increment...\n";
- $c->$name->prop++;
- $c->$name = $value; // reset value in case implicit conversion was successful
-
- echo "\n --> Attempting implicit conversion to object using assignment...\n";
- $c->$name->prop = "Implicit instantiation!";
- $c->$name = $value; // reset value in case implicit conversion was successful
-
- echo "\n --> Attempting implicit conversion to object using combined assignment...\n";
- $c->$name->prop .= " Implicit instantiation!";
-}
-
-echo "\n\n\n --> Resulting object:";
-var_dump($c);
-
-?>
---EXPECTF--
----( $c->boolFalse )---
- --> Attempting implicit conversion to object using increment...
-
-Warning: Creating default object from empty value in %s on line 18
-
-Notice: Undefined property: stdClass::$prop in %s on line 18
-
- --> Attempting implicit conversion to object using assignment...
-
-Warning: Creating default object from empty value in %s on line 22
-
- --> Attempting implicit conversion to object using combined assignment...
-
-Warning: Creating default object from empty value in %s on line 26
-
-Notice: Undefined property: stdClass::$prop in %s on line 26
-
-
----( $c->emptyString )---
- --> Attempting implicit conversion to object using increment...
-
-Warning: Creating default object from empty value in %s on line 18
-
-Notice: Undefined property: stdClass::$prop in %s on line 18
-
- --> Attempting implicit conversion to object using assignment...
-
-Warning: Creating default object from empty value in %s on line 22
-
- --> Attempting implicit conversion to object using combined assignment...
-
-Warning: Creating default object from empty value in %s on line 26
-
-Notice: Undefined property: stdClass::$prop in %s on line 26
-
-
----( $c->null )---
- --> Attempting implicit conversion to object using increment...
-
-Warning: Creating default object from empty value in %s on line 18
-
-Notice: Undefined property: stdClass::$prop in %s on line 18
-
- --> Attempting implicit conversion to object using assignment...
-
-Warning: Creating default object from empty value in %s on line 22
-
- --> Attempting implicit conversion to object using combined assignment...
-
-Warning: Creating default object from empty value in %s on line 26
-
-Notice: Undefined property: stdClass::$prop in %s on line 26
-
-
----( $c->boolTrue )---
- --> Attempting implicit conversion to object using increment...
-
-Warning: Attempt to %s property 'prop' of non-object in %s on line 18
-
- --> Attempting implicit conversion to object using assignment...
-
-Warning: Attempt to assign property 'prop' of non-object in %s on line 22
-
- --> Attempting implicit conversion to object using combined assignment...
-
-Warning: Attempt to assign property 'prop' of non-object in %s on line 26
-
-
----( $c->nonEmptyString )---
- --> Attempting implicit conversion to object using increment...
-
-Warning: Attempt to %s property 'prop' of non-object in %s on line 18
-
- --> Attempting implicit conversion to object using assignment...
-
-Warning: Attempt to assign property 'prop' of non-object in %s on line 22
-
- --> Attempting implicit conversion to object using combined assignment...
-
-Warning: Attempt to assign property 'prop' of non-object in %s on line 26
-
-
----( $c->intZero )---
- --> Attempting implicit conversion to object using increment...
-
-Warning: Attempt to %s property 'prop' of non-object in %s on line 18
-
- --> Attempting implicit conversion to object using assignment...
-
-Warning: Attempt to assign property 'prop' of non-object in %s on line 22
-
- --> Attempting implicit conversion to object using combined assignment...
-
-Warning: Attempt to assign property 'prop' of non-object in %s on line 26
-
-
-
- --> Resulting object:object(C)#%d (6) {
- ["boolFalse"]=>
- object(stdClass)#%d (1) {
- ["prop"]=>
- string(24) " Implicit instantiation!"
- }
- ["emptyString"]=>
- object(stdClass)#%d (1) {
- ["prop"]=>
- string(24) " Implicit instantiation!"
- }
- ["null"]=>
- object(stdClass)#%d (1) {
- ["prop"]=>
- string(24) " Implicit instantiation!"
- }
- ["boolTrue"]=>
- bool(true)
- ["nonEmptyString"]=>
- string(5) "hello"
- ["intZero"]=>
- int(0)
-}
}
$id = new Id();
-@$obj->foo = "bar";
+$obj = new stdClass;
+$obj->foo = "bar";
$id->tester($obj);
print_r($obj);
?>
--TEST--
Bug #7515 (weird & invisible referencing of objects)
---INI--
-error_reporting=2039
--FILE--
<?php
class obj {
function method() {}
}
-$o->root=new obj();
+$o = new stdClass;
+$o->root = new obj();
ob_start();
var_dump($o);
";
}
?>
---EXPECTF--
-Warning: Creating default object from empty value in %s on line %d
+--EXPECT--
success
unset($i);
echo "\n" . '$i->p=f(): ';
+$i = new stdClass;
echo $a[$i->p=f()][++$i->p];
unset($i);
echo "\n" . '$i->p->q=f(): ';
+$i = new stdClass;
+$i->p = new stdClass;
echo $a[$i->p->q=f()][++$i->p->q];
unset($i);
echo "\n" . '$i->p[0]=f(): ';
+$i = new stdClass;
echo $a[$i->p[0]=f()][++$i->p[0]];
unset($i);
echo "\n" . '$i->p[0]->p=f(): ';
+$i = new stdClass;
+$i->p[0] = new stdClass;
echo $a[$i->p[0]->p=f()][++$i->p[0]->p];
unset($i);
C::$p = new stdclass;
echo $a[C::$p->q=f()][++C::$p->q];
?>
---EXPECTF--
+--EXPECT--
$i=f(): good
$$x=f(): good
${'i'}=f(): good
$i[0]=f(): good
$i[0][0]=f(): good
-$i->p=f():
-Warning: Creating default object from empty value in %s on line %d
-good
-$i->p->q=f():
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-good
-$i->p[0]=f():
-Warning: Creating default object from empty value in %s on line %d
-good
-$i->p[0]->p=f():
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
-good
+$i->p=f(): good
+$i->p->q=f(): good
+$i->p[0]=f(): good
+$i->p[0]->p=f(): good
C::$p=f(): good
C::$p[0]=f(): good
C::$p->q=f(): good
unset($a, $b);
echo "\n" . '$a->b' . "\n";
+ $a = new stdClass;
$b = $a->b = array('original');
foreach($a->b as $k=>&$v) {
$v = 'changed';
unset($a, $b);
echo "\n" . '$a->b->c' . "\n";
+ $a = new stdClass;
+ $a->b = new stdClass;
$b = $a->b->c = array('original');
foreach($a->b as $k=>&$v) {
$v = 'changed';
unset($a, $b);
echo "\n" . '$a->b[0]' . "\n";
+ $a = new stdClass;
$b = $a->b[0] = array('original');
foreach($a->b[0] as $k=>&$v) {
$v = 'changed';
unset($a, $b);
echo "\n" . '$a->b[0][0]' . "\n";
+ $a = new stdClass;
$b = $a->b[0][0] = array('original');
foreach($a->b[0][0] as $k=>&$v) {
$v = 'changed';
unset($a, $b);
echo "\n" . '$a->b[0]->c' . "\n";
+ $a = new stdClass;
+ $a->b[0] = new stdClass;
$b = $a->b[0]->c = array('original');
foreach($a->b[0]->c as $k=>&$v) {
$v = 'changed';
unset(C::$a[0], $b);
echo "\n" . 'C::$a[0]->b' . "\n";
+ C::$a[0] = new stdClass;
C::$a[0]->b = array('original');
$b = C::$a[0]->b;
foreach(C::$a[0]->b as $k=>&$v) {
var_dump($b);
unset(C::$a[0]->b, $b);
?>
---EXPECTF--
+--EXPECT--
$a
array(1) {
[0]=>
}
$a->b
-
-Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
$a->b->c
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
$a->b[0]
-
-Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
$a->b[0][0]
-
-Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
$a->b[0]->c
-
-Warning: Creating default object from empty value in %s on line %d
-
-Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
C::$a[0]->b
-
-Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
--FILE--
<?php
-function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+function refs(&$ref1, &$ref2) {
$ref1 = "Ref1 changed";
$ref2 = "Ref2 changed";
- $ref3 = "Ref3 changed";
- $ref4 = "Ref4 changed";
- $ref5 = "Ref5 changed";
}
class C {
- function __construct(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+ function __construct(&$ref1, &$ref2) {
$ref1 = "Ref1 changed";
$ref2 = "Ref2 changed";
- $ref3 = "Ref3 changed";
- $ref4 = "Ref4 changed";
- $ref5 = "Ref5 changed";
}
- function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+ function refs(&$ref1, &$ref2) {
$ref1 = "Ref1 changed";
$ref2 = "Ref2 changed";
- $ref3 = "Ref3 changed";
- $ref4 = "Ref4 changed";
- $ref5 = "Ref5 changed";
}
- static function static_refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+ static function static_refs(&$ref1, &$ref2) {
$ref1 = "Ref1 changed";
$ref2 = "Ref2 changed";
- $ref3 = "Ref3 changed";
- $ref4 = "Ref4 changed";
- $ref5 = "Ref5 changed";
}
}
echo "\n ---- Pass uninitialised array & object by ref: function call ---\n";
-unset($u1, $u2, $u3, $u4, $u5);
-refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
-var_dump($u1, $u2, $u3, $u4, $u5);
+unset($u1, $u2);
+refs($u1[0], $u2[0][1]);
+var_dump($u1, $u2);
echo "\n ---- Pass uninitialised arrays & objects by ref: static method call ---\n";
-unset($u1, $u2, $u3, $u4, $u5);
-C::static_refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
-var_dump($u1, $u2, $u3, $u4, $u5);
+unset($u1, $u2);
+C::static_refs($u1[0], $u2[0][1]);
+var_dump($u1, $u2);
echo "\n\n---- Pass uninitialised arrays & objects by ref: constructor ---\n";
-unset($u1, $u2, $u3, $u4, $u5);
-$c = new C($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
-var_dump($u1, $u2, $u3, $u4, $u5);
+unset($u1, $u2);
+$c = new C($u1[0], $u2[0][1]);
+var_dump($u1, $u2);
echo "\n ---- Pass uninitialised arrays & objects by ref: instance method call ---\n";
-unset($u1, $u2, $u3, $u4, $u5);
-$c->refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
-var_dump($u1, $u2, $u3, $u4, $u5);
+unset($u1, $u2);
+$c->refs($u1[0], $u2[0][1]);
+var_dump($u1, $u2);
?>
---EXPECTF--
- ---- Pass uninitialised array & object by ref: function call ---
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+--EXPECT--
+---- Pass uninitialised array & object by ref: function call ---
array(1) {
[0]=>
string(12) "Ref1 changed"
string(12) "Ref2 changed"
}
}
-object(stdClass)#%d (1) {
- ["a"]=>
- string(12) "Ref3 changed"
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- string(12) "Ref4 changed"
- }
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- object(stdClass)#%d (1) {
- ["c"]=>
- string(12) "Ref5 changed"
- }
- }
-}
---- Pass uninitialised arrays & objects by ref: static method call ---
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"
string(12) "Ref2 changed"
}
}
-object(stdClass)#%d (1) {
- ["a"]=>
- string(12) "Ref3 changed"
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- string(12) "Ref4 changed"
- }
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- object(stdClass)#%d (1) {
- ["c"]=>
- string(12) "Ref5 changed"
- }
- }
-}
---- Pass uninitialised arrays & objects by ref: constructor ---
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"
string(12) "Ref2 changed"
}
}
-object(stdClass)#%d (1) {
- ["a"]=>
- string(12) "Ref3 changed"
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- string(12) "Ref4 changed"
- }
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- object(stdClass)#%d (1) {
- ["c"]=>
- string(12) "Ref5 changed"
- }
- }
-}
---- Pass uninitialised arrays & objects by ref: instance method call ---
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
-
-Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"
string(12) "Ref2 changed"
}
}
-object(stdClass)#%d (1) {
- ["a"]=>
- string(12) "Ref3 changed"
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- string(12) "Ref4 changed"
- }
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- object(stdClass)#%d (1) {
- ["b"]=>
- object(stdClass)#%d (1) {
- ["c"]=>
- string(12) "Ref5 changed"
- }
- }
-}