3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ':es:es-ES'; $b = substr($a, 0, 3); //:es $c = substr($a, 3); //:es-ES echo $a /n; echo $b /n; echo $c;
based on dtK0U
Output for 7.2.0 - 7.3.0alpha1
Warning: Use of undefined constant n - assumed 'n' (this will throw an Error in a future version of PHP) in /in/sIkIj on line 7 Warning: A non-numeric value encountered in /in/sIkIj on line 7 Warning: A non-numeric value encountered in /in/sIkIj on line 7 Warning: Division by zero in /in/sIkIj on line 7 NAN Warning: Use of undefined constant n - assumed 'n' (this will throw an Error in a future version of PHP) in /in/sIkIj on line 8 Warning: A non-numeric value encountered in /in/sIkIj on line 8 Warning: A non-numeric value encountered in /in/sIkIj on line 8 Warning: Division by zero in /in/sIkIj on line 8 NAN:es-ES
Output for 7.1.0 - 7.1.10
Notice: Use of undefined constant n - assumed 'n' in /in/sIkIj on line 7 Warning: A non-numeric value encountered in /in/sIkIj on line 7 Warning: A non-numeric value encountered in /in/sIkIj on line 7 Warning: Division by zero in /in/sIkIj on line 7 NAN Notice: Use of undefined constant n - assumed 'n' in /in/sIkIj on line 8 Warning: A non-numeric value encountered in /in/sIkIj on line 8 Warning: A non-numeric value encountered in /in/sIkIj on line 8 Warning: Division by zero in /in/sIkIj on line 8 NAN:es-ES
Output for 7.0.0 - 7.0.20
Notice: Use of undefined constant n - assumed 'n' in /in/sIkIj on line 7 Warning: Division by zero in /in/sIkIj on line 7 NAN Notice: Use of undefined constant n - assumed 'n' in /in/sIkIj on line 8 Warning: Division by zero in /in/sIkIj on line 8 NAN:es-ES
Output for 5.3.21 - 5.6.28
Notice: Use of undefined constant n - assumed 'n' in /in/sIkIj on line 7 Warning: Division by zero in /in/sIkIj on line 7 Notice: Use of undefined constant n - assumed 'n' in /in/sIkIj on line 8 Warning: Division by zero in /in/sIkIj on line 8 :es-ES