summaryrefslogtreecommitdiff
path: root/tests/lang/passByReference_012.phpt
blob: 3bc60a484e1c8eec71366549d428af77b53ac4d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Test pass by reference semantics
--FILE--
<?php
// Simplified array_shift_variation5.phpt
// Showing warning:
// "Only variables should be passed by reference in %s on line %d"
$stack = array ( array ( 'two' ));
var_dump(array_shift(array_shift($stack)));

// This should show the identical warning
$original = array ( array ( 'one' ));
$stack = $original;
var_dump(array_shift(array_shift($stack)));
?>
===DONE===
--EXPECTF--
Notice: Only variables should be passed by reference in %s on line %d
string(3) "two"

Notice: Only variables should be passed by reference in %s on line %d
string(3) "one"
===DONE===