12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- --TEST--
- Bug #75921: Inconsistent error when creating stdObject from empty variable
- --FILE--
- <?php
- try {
- $null->a = 42;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
- }
- var_dump($null);
- unset($null);
- try {
- $null->a['hello'] = 42;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
- }
- var_dump($null);
- unset($null);
- try {
- $null->a->b = 42;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
- }
- var_dump($null);
- unset($null);
- try {
- $null->a['hello']->b = 42;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
- }
- var_dump($null);
- unset($null);
- try {
- $null->a->b['hello'] = 42;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
- }
- var_dump($null);
- unset($null);
- ?>
- --EXPECTF--
- Attempt to assign property "a" on null
- Warning: Undefined variable $null in %s on line %d
- NULL
- Attempt to modify property "a" on null
- Warning: Undefined variable $null in %s on line %d
- NULL
- Attempt to modify property "a" on null
- Warning: Undefined variable $null in %s on line %d
- NULL
- Attempt to modify property "a" on null
- Warning: Undefined variable $null in %s on line %d
- NULL
- Attempt to modify property "a" on null
- Warning: Undefined variable $null in %s on line %d
- NULL
|