in reply to Array shuffle code produces 'Modification of non-creatable array value attempted' error
The probable cause is passing an empty array to shuffle:
shuffle([]);