source: src/router/php7/Zend/tests/call_user_func_006.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 3 months ago

update php

File size: 483 bytes
Line 
1--TEST--
2call_user_func() should error on reference arguments
3--FILE--
4<?php
5
6namespace Foo;
7
8function bar(&$ref) {
9    $ref = 24;
10}
11
12$x = 42;
13$ref =& $x;
14\call_user_func('Foo\bar', $x);
15var_dump($x);
16
17$y = 42;
18$ref =& $y;
19call_user_func('Foo\bar', $y);
20var_dump($y);
21
22?>
23--EXPECTF--
24Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
25int(42)
26
27Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
28int(42)
Note: See TracBrowser for help on using the repository browser.