3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = 'tacocat'; $code = ''; for ($i = strlen($input) - 1; $i >= 0; $i--) { $code .= ($code ? '.' : '') . sprintf('$input[%s]', $i); } $code = sprintf('return %s;', $code); var_dump($code); var_dump(eval($code));
based on gTL2C
Output for 4.3.0 - 7.2.0
string(77) "return $input[6].$input[5].$input[4].$input[3].$input[2].$input[1].$input[0];" string(7) "tacocat"