3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "someval"; echo $str[str.length -1 ];
based on 7hevP
Output for 7.2.0
Warning: Use of undefined constant str - assumed 'str' (this will throw an Error in a future version of PHP) in /in/rJTWS on line 4 Warning: Use of undefined constant length - assumed 'length' (this will throw an Error in a future version of PHP) in /in/rJTWS on line 4 Warning: A non-numeric value encountered in /in/rJTWS on line 4 l
Output for 7.1.0 - 7.1.10
Notice: Use of undefined constant str - assumed 'str' in /in/rJTWS on line 4 Notice: Use of undefined constant length - assumed 'length' in /in/rJTWS on line 4 Warning: A non-numeric value encountered in /in/rJTWS on line 4 l
Output for 5.3.22 - 7.0.20
Notice: Use of undefined constant str - assumed 'str' in /in/rJTWS on line 4 Notice: Use of undefined constant length - assumed 'length' in /in/rJTWS on line 4 Notice: Uninitialized string offset: -1 in /in/rJTWS on line 4