codegooglecom / querytemplates

Automatically exported from code.google.com/p/querytemplates
0 stars 0 forks source link

Using isset raises an error for objects #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Report from Andreas Kalsch.

Following code from "output.code.php" causes "Fatal error: Cannot use object 
of type stdClass as array".

$d = new stdclass;
$d->a = 1;
var_dump(isset($d['a']));

Solution:

if (is_array($data) && isset($data['objs'])) $__242d2 = $data['objs']; else 
if (isset($data->{'objs'})) $__242d2 = $data->{'objs'}; 

Original issue reported on code.google.com by tobiasz....@gmail.com on 28 Dec 2009 at 8:03