xref: /PHP-5.6/Zend/tests/increment_001.phpt (revision 56a27267)
1--TEST--
2incrementing different variables
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
5--INI--
6precision=14
7--FILE--
8<?php
9
10$a = array(
11	array(1,2,3),
12	"",
13	1,
14	2.5,
15	0,
16	"string",
17	"123",
18	"2.5",
19	NULL,
20	true,
21	false,
22	new stdclass,
23	array(),
24	PHP_INT_MAX,
25	(string)PHP_INT_MAX
26);
27
28foreach ($a as $var) {
29	$var++;
30	var_dump($var);
31}
32
33echo "Done\n";
34?>
35--EXPECTF--
36array(3) {
37  [0]=>
38  int(1)
39  [1]=>
40  int(2)
41  [2]=>
42  int(3)
43}
44string(1) "1"
45int(2)
46float(3.5)
47int(1)
48string(6) "strinh"
49int(124)
50float(3.5)
51int(1)
52bool(true)
53bool(false)
54object(stdClass)#%d (0) {
55}
56array(0) {
57}
58float(2147483648)
59float(2147483648)
60Done
61