3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = Array ( 0 => 'timestamp', 1 => '1447931724.712686', 2 => 'bridgeid', 3 => 'bc343ddc-78bf-4e5c-8ba5-cb0a9893a81a' ); function redishash_toarray ($in) { $arr = ''; $c = count($in)/2; for ( $k = 0 ; $k < $c; $k++) { $arr[$in[$k * 2 ]]=$in[$k * 2 + 1]; } } print_r(redishash_toarray ($arr));
based on SSQsm
Output for 7.1.0 - 7.2.0
Warning: Illegal string offset 'timestamp' in /in/HafQP on line 16 Warning: Illegal string offset 'bridgeid' in /in/HafQP on line 16
Output for 5.3.19 - 7.0.20