3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isCorrect($string) { $string{strlen($string)-1}; } $string = '()'; var_dump($string{strlen($string)}); //assert(isCorrect('') === true); //assert(isCorrect('()') === true); //assert(isCorrect('{()}') === true); //assert(isCorrect('{()}{}') === true); //assert(isCorrect('(())') === true); //assert(isCorrect('{({({({()})})})}') === true); //assert(isCorrect('{(})') === false);
based on Ns8pB
Output for 5.2.10 - 7.2.0
Notice: Uninitialized string offset: 2 in /in/43l4J on line 6 string(0) ""
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.2.9
Notice: Uninitialized string offset: 2 in /in/43l4J on line 6 string(0) ""
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/43l4J on line 13
Process exited with code 255.