3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isCorrect($string) { $string{strlen($string)-1}; } assert(isCorrect('') === true); assert(isCorrect('()') === true); assert(isCorrect('{()}') === true); assert(isCorrect('{()}{}') === true); assert(isCorrect('(())') === true); assert(isCorrect('{({({({()})})})}') === true); assert(isCorrect('{(})') === false);
based on BdC2k
Output for 7.0.1 - 7.1.0
Notice: Uninitialized string offset: -1 in /in/VX18e on line 3 Warning: assert(): assert(isCorrect('') === true) failed in /in/VX18e on line 5 Warning: assert(): assert(isCorrect('()') === true) failed in /in/VX18e on line 6 Warning: assert(): assert(isCorrect('{()}') === true) failed in /in/VX18e on line 7 Warning: assert(): assert(isCorrect('{()}{}') === true) failed in /in/VX18e on line 8 Warning: assert(): assert(isCorrect('(())') === true) failed in /in/VX18e on line 9 Warning: assert(): assert(isCorrect('{({({({()})})})}') === true) failed in /in/VX18e on line 10 Warning: assert(): assert(isCorrect('{(})') === false) failed in /in/VX18e on line 11
Output for 5.4.0 - 5.6.28
Notice: Uninitialized string offset: -1 in /in/VX18e on line 3 Warning: assert(): Assertion failed in /in/VX18e on line 5 Warning: assert(): Assertion failed in /in/VX18e on line 6 Warning: assert(): Assertion failed in /in/VX18e on line 7 Warning: assert(): Assertion failed in /in/VX18e on line 8 Warning: assert(): Assertion failed in /in/VX18e on line 9 Warning: assert(): Assertion failed in /in/VX18e on line 10 Warning: assert(): Assertion failed in /in/VX18e on line 11
Output for 4.3.2 - 5.3.29
Warning: assert(): Assertion failed in /in/VX18e on line 5 Warning: assert(): Assertion failed in /in/VX18e on line 6 Warning: assert(): Assertion failed in /in/VX18e on line 7 Warning: assert(): Assertion failed in /in/VX18e on line 8 Warning: assert(): Assertion failed in /in/VX18e on line 9 Warning: assert(): Assertion failed in /in/VX18e on line 10 Warning: assert(): Assertion failed in /in/VX18e on line 11
Output for 4.3.0 - 4.3.1
Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 5 Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 6 Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 7 Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 8 Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 9 Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 10 Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/VX18e on line 11