3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $row = new stdClass; $field_name = 'field_my_field'; $delta = 0; $row->{$field_name}[$delta] = 'value'; // This works just fine. echo $row->$fieldname[0]; $title_field = $field_name . ':title'; $row->{$field_name . ':title'} = array($delta => 'title');
based on dEhdn
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: fieldname in /in/8cl2K on line 7 Notice: Undefined property: stdClass::$ in /in/8cl2K on line 7
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: fieldname in /in/8cl2K on line 7 Fatal error: Uncaught Error: Cannot access empty property in /in/8cl2K:7 Stack trace: #0 {main} thrown in /in/8cl2K on line 7
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Notice: Undefined variable: fieldname in /in/8cl2K on line 7 Fatal error: Cannot access empty property in /in/8cl2K on line 7
Process exited with code 255.