xref: /PHP-7.2/Zend/tests/bug62005.phpt (revision 70668fd8)
1--TEST--
2Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
3--FILE--
4<?php
5function add_points($player, $points) {
6    $player->energy += $points;
7    print_r($player);
8}
9add_points(NULL, 2);
10--EXPECTF--
11Warning: Creating default object from empty value in %sbug62005.php on line %d
12
13Notice: Undefined property: stdClass::$energy in %sbug62005.php on line 3
14stdClass Object
15(
16    [energy] => 2
17)
18