1--TEST--
2Cannot increment/decrement objects
3--FILE--
4<?php
5class Foo { }
6$o = new Foo;
7
8try {
9    $o++;
10} catch (\TypeError $e) {
11    echo $e->getMessage(), PHP_EOL;
12    var_dump($o);
13}
14try {
15    $o--;
16} catch (\TypeError $e) {
17    echo $e->getMessage(), PHP_EOL;
18    var_dump($o);
19}
20try {
21    ++$o;
22} catch (\TypeError $e) {
23    echo $e->getMessage(), PHP_EOL;
24    var_dump($o);
25}
26try {
27    --$o;
28} catch (\TypeError $e) {
29    echo $e->getMessage(), PHP_EOL;
30    var_dump($o);
31}
32?>
33--EXPECT--
34Cannot increment Foo
35object(Foo)#1 (0) {
36}
37Cannot decrement Foo
38object(Foo)#1 (0) {
39}
40Cannot increment Foo
41object(Foo)#1 (0) {
42}
43Cannot decrement Foo
44object(Foo)#1 (0) {
45}
46