3v4l.org

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