3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $len = 9; echo implode('', array_keys(array_fill(1, 9, ''))) . '|' . 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 3uNUU
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
123456789| Déja vu | Déja vu |
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/c2D4d on line 3 123456789|PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/c2D4d on line 4 Déja vu |PHP_EOLDéja vu |