Browse Source
Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
pull/1872/head
Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
pull/1872/head
6 changed files with 61 additions and 33 deletions
-
4NEWS
-
3Zend/tests/bug34617.phpt
-
27Zend/tests/bug72038.phpt
-
6Zend/tests/each_002.phpt
-
27Zend/zend_vm_def.h
-
27Zend/zend_vm_execute.h
@ -0,0 +1,27 @@ |
|||
--TEST-- |
|||
Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice) |
|||
--FILE-- |
|||
<?php |
|||
|
|||
test($foo = new stdClass); |
|||
var_dump($foo); |
|||
test($bar = 2); |
|||
var_dump($bar); |
|||
test($baz = &$bar); |
|||
var_dump($baz); |
|||
|
|||
function test(&$param) { |
|||
$param = 1; |
|||
} |
|||
|
|||
?> |
|||
--EXPECTF-- |
|||
|
|||
Notice: Only variables should be passed by reference in %s on line %d |
|||
object(stdClass)#1 (0) { |
|||
} |
|||
|
|||
Notice: Only variables should be passed by reference in %s on line %d |
|||
int(2) |
|||
int(1) |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue