3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.+++.'; $commands = array( '>' => '$ptr++;', '<' => '$ptr--;', '+' => '$cells[$ptr]++;', '-' => '$cells[$ptr]--;', '.' => 'echo chr($cells[$ptr]);', ',' => 'throw new Exception(", not supported");', '[' => 'while($cells[$ptr]) {', ']' => '}' ); $php_code = strtr($code, $commands); $cells = array( 0, 0, 0, 0, 0, 0, 0, 0 ); $ptr = 0; eval($php_code);
based on njB0A
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Hello World!