1--TEST--
2Unset variable via $GLOBALS array in error_handler
3--FILE--
4<?php
5set_error_handler(function($_, $m) {
6    echo "$m\n";
7    unset($GLOBALS['x']);
8});
9echo "NULL (only --)\n";
10echo "POST DEC\n";
11$x = null;
12var_dump($x--);
13unset($x);
14echo "PRE DEC\n";
15$x = null;
16var_dump(--$x);
17unset($x);
18echo "Empty string\n";
19echo "POST INC\n";
20$x = "";
21var_dump($x++);
22unset($x);
23echo "POST DEC\n";
24$x = "";
25var_dump($x--);
26unset($x);
27echo "PRE INC\n";
28$x = "";
29var_dump(++$x);
30unset($x);
31echo "PRE DEC\n";
32$x = "";
33var_dump(--$x);
34unset($x);
35echo "Non fill ASCII (only ++)\n";
36echo "POST INC\n";
37$x = " ad ";
38var_dump($x++);
39unset($x);
40echo "PRE INC\n";
41$x = " ad ";
42var_dump(++$x);
43unset($x);
44echo "Bool\n";
45echo "POST INC\n";
46$x = false;
47var_dump($x++);
48unset($x);
49echo "POST DEC\n";
50$x = false;
51var_dump($x--);
52unset($x);
53echo "PRE INC\n";
54$x = false;
55var_dump(++$x);
56unset($x);
57echo "PRE DEC\n";
58$x = false;
59var_dump(--$x);
60unset($x);
61echo "POST INC\n";
62$x = true;
63var_dump($x++);
64unset($x);
65echo "POST DEC\n";
66$x = true;
67var_dump($x--);
68unset($x);
69echo "PRE INC\n";
70$x = true;
71var_dump(++$x);
72unset($x);
73echo "PRE DEC\n";
74$x = true;
75var_dump(--$x);
76unset($x);
77?>
78--EXPECT--
79NULL (only --)
80POST DEC
81Decrement on type null has no effect, this will change in the next major version of PHP
82NULL
83PRE DEC
84Decrement on type null has no effect, this will change in the next major version of PHP
85NULL
86Empty string
87POST INC
88Increment on non-alphanumeric string is deprecated
89string(0) ""
90POST DEC
91Decrement on empty string is deprecated as non-numeric
92string(0) ""
93PRE INC
94Increment on non-alphanumeric string is deprecated
95string(1) "1"
96PRE DEC
97Decrement on empty string is deprecated as non-numeric
98int(-1)
99Non fill ASCII (only ++)
100POST INC
101Increment on non-alphanumeric string is deprecated
102string(4) " ad "
103PRE INC
104Increment on non-alphanumeric string is deprecated
105string(4) " ad "
106Bool
107POST INC
108Increment on type bool has no effect, this will change in the next major version of PHP
109bool(false)
110POST DEC
111Decrement on type bool has no effect, this will change in the next major version of PHP
112bool(false)
113PRE INC
114Increment on type bool has no effect, this will change in the next major version of PHP
115bool(false)
116PRE DEC
117Decrement on type bool has no effect, this will change in the next major version of PHP
118bool(false)
119POST INC
120Increment on type bool has no effect, this will change in the next major version of PHP
121bool(true)
122POST DEC
123Decrement on type bool has no effect, this will change in the next major version of PHP
124bool(true)
125PRE INC
126Increment on type bool has no effect, this will change in the next major version of PHP
127bool(true)
128PRE DEC
129Decrement on type bool has no effect, this will change in the next major version of PHP
130bool(true)
131