3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sql = array("inUserID" => "lemon", "inCustID" => "orange", "btAll" => "banana", "btPermPref" => "apple", "inDisplay"=>"toast"); function pram_alter($array, $key) { foreach ($array as $value){ echo "$key= '$key'"; echo "$value"; } } //$temp=array(); $temp=array(pram_alter($sql, 'pram_alter')); echo print_r($temp); ?>
based on lX6SZ
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
pram_alter= 'pram_alter'lemonpram_alter= 'pram_alter'orangepram_alter= 'pram_alter'bananapram_alter= 'pram_alter'applepram_alter= 'pram_alter'toastArray ( [0] => ) 1