3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'abc'; // Zo kort dat het geen function waard is :P var_dump($str{0} == 'a', $str{-1} == 'c');
Output for 8.4.1 - 8.4.12
Parse error: syntax error, unexpected token "{", expecting ")" in /in/eq1cK on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/eq1cK on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/eq1cK on line 6 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/eq1cK on line 6 bool(true) bool(true)
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
bool(true) bool(true)
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33
Notice: Uninitialized string offset: -1 in /in/eq1cK on line 6 bool(true) bool(false)

preferences:
148.02 ms | 411 KiB | 5 Q