Sub-femtosecond dynamics and dissociation of C-H bonds in solid polystyrene and liquid benzene