I've was working on some old parts of a website and found myself in a situation where I have to run the following code
<?=($stone->2_way)? 'checked' : ''?>
Attempting to do this causes the page to crash while this
<?=($stone->rectangular)? 'checked' : ''?>
doesn't. I'm wondering if it is because the variable starts with a number? I can var_dump the stone object and get
object(Cut_Stone)#54 (6) {
["errors"]=>
NULL
["attributes":"ActiveRecord\Model":private]=>
array(13) {
["stone_id"]=>
int(24)
["stone_name"]=>
string(11) "Test Stone "
["active"]=>
int(1)
["rectangular"]=>
int(1)
["2_way"]=>
int(1)
["3_piece_radius"]=>
int(1)
["3_piece_straight"]=>
int(1)
["wedge"]=>
int(1)
["partial_wash"]=>
int(1)
["pier_cap"]=>
int(1)
["pier_cap_w_flat"]=>
int(1)
["radiused_hearth"]=>
int(1)
["total_washed"]=>
int(1)
}
["__dirty":"ActiveRecord\Model":private]=>
array(0) {
}
["__readonly":"ActiveRecord\Model":private]=>
bool(false)
["__relationships":"ActiveRecord\Model":private]=>
array(0) {
}
["__new_record":"ActiveRecord\Model":private]=>
bool(false)
}
Also it is important to note that this object has been used in other places without fail, so I don't really get what is going on here.