3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $len = 9; echo implode('', array_keys(array_fill(1, 9, ''))); echo str_pad('Foo', $len) . '|' . PHP_EOL; echo str_pad('Déja vu', $len) . '|' . PHP_EOL; echo 'Déja vu'.str_repeat(' ', $len - mb_strwidth('Déja vu', mb_detect_encoding('Déja vu'))) . '|';
based on OSC0s
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
123456789Foo | Déja vu | Déja vu |
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
123456789 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/HkQKP on line 4 Foo |PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/HkQKP on line 5 Déja vu |PHP_EOLDéja vu |