1--TEST-- 2ReflectionParameter class - canBePassedByValue() method. 3--FILE-- 4<?php 5 6function aux($fun) { 7 8 $func = new ReflectionFunction($fun); 9 $parameters = $func->getParameters(); 10 foreach($parameters as $parameter) { 11 echo "Name: ", $parameter->getName(), "\n"; 12 echo "Is passed by reference: ", $parameter->isPassedByReference()?"yes":"no", "\n"; 13 echo "Can be passed by value: ", $parameter->canBePassedByValue()?"yes":"no", "\n"; 14 echo "\n"; 15 } 16 17} 18 19echo "=> array_multisort:\n\n"; 20 21aux('array_multisort'); 22 23 24echo "=> sort:\n\n"; 25 26aux('sort'); 27 28echo "=> user function:\n\n"; 29 30function ufunc(&$array1, $array2) {} 31 32aux('ufunc'); 33 34echo "Done.\n"; 35 36?> 37--EXPECT-- 38=> array_multisort: 39 40Name: array 41Is passed by reference: yes 42Can be passed by value: yes 43 44Name: rest 45Is passed by reference: yes 46Can be passed by value: yes 47 48=> sort: 49 50Name: array 51Is passed by reference: yes 52Can be passed by value: no 53 54Name: flags 55Is passed by reference: no 56Can be passed by value: yes 57 58=> user function: 59 60Name: array1 61Is passed by reference: yes 62Can be passed by value: no 63 64Name: array2 65Is passed by reference: no 66Can be passed by value: yes 67 68Done. 69