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->$data){ echo "$value= '$data'"; } } //$temp=array(); $temp=array(pram_alter($sql, 'pram_alter')); echo print_r($temp); ?>
based on ZrJBj
Output for 7.1.0
Notice: Undefined variable: data in /in/TSvqc on line 6 Warning: Creating default object from empty value in /in/TSvqc on line 6 Recoverable fatal error: Object of class stdClass could not be converted to string in /in/TSvqc on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Notice: Undefined variable: data in /in/TSvqc on line 6 Warning: Creating default object from empty value in /in/TSvqc on line 6 Fatal error: Uncaught Error: Cannot access empty property in /in/TSvqc:6 Stack trace: #0 /in/TSvqc(12): pram_alter(Array, 'pram_alter') #1 {main} thrown in /in/TSvqc on line 6
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Cannot access empty property in /in/TSvqc on line 8
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Undefined variable: data in /in/TSvqc on line 6 Warning: Creating default object from empty value in /in/TSvqc on line 6 Fatal error: Cannot access empty property in /in/TSvqc on line 6
Process exited with code 255.
Output for 5.1.0 - 5.3.29
Notice: Undefined variable: data in /in/TSvqc on line 6 Strict Standards: Creating default object from empty value in /in/TSvqc on line 6 Fatal error: Cannot access empty property in /in/TSvqc on line 6
Process exited with code 255.
Output for 5.0.5
Notice: Undefined variable: data in /in/TSvqc on line 6 Fatal error: Cannot access empty property in /in/TSvqc on line 6
Process exited with code 255.
Output for 5.0.4
Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= ''Array ( [0] => ) 1
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object id #1= ''Array ( [0] => ) 1
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object= '' Notice: Undefined variable: data in /in/TSvqc on line 6 Notice: Undefined variable: data in /in/TSvqc on line 7 Object= ''Array ( [0] => ) 1