3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isCorrect($string) { if (strlen($string) % 2) { for( $i = 0; $i < strlen($string); $i++) { $string; } return true; } return false; } $string = '({{}})'; var_dump(isCorrect($string)); //assert(isCorrect('') === true); //assert(isCorrect('()') === true); //assert(isCorrect('{()}') === true); //assert(isCorrect('{()}{}') === true); //assert(isCorrect('(())') === true); //assert(isCorrect('{({({({()})})})}') === true); //assert(isCorrect('{(})') === false);
based on 1kaMo
Output for 4.3.0 - 5.0.5, 5.1.1 - 7.1.0
bool(false)
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/nIKbO on line 19
Process exited with code 255.