summaryrefslogtreecommitdiff
path: root/Zend/tests/list_005.phpt
blob: 4afc353b2f989708113c2fe0b5e8ef1e4307d53c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--TEST--
Testing list() with several variables
--FILE--
<?php

$a = "foo";

list($a, $b, $c) = $a;

var_dump($a, $b, $c);

print "----\n";

$a = 1;

list($a, $b, $c) = $a;

var_dump($a, $b, $c);

print "----\n";

$a = new stdClass;

list($a, $b, $c) = $a;

var_dump($a, $b, $c);

print "----\n";

$a = array(1, 2, 3);

list($a, $b, $c) = $a;

var_dump($a, $b, $c);

?>
--EXPECTF--
string(1) "f"
string(1) "o"
string(1) "o"
----
NULL
NULL
NULL
----

Fatal error: Cannot use object of type stdClass as array in %s on line %d