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 V4YhG
Output for 5.3.0 - 7.1.0
Warning: array_fill() expects exactly 3 parameters, 2 given in /in/OSC0s on line 3 Warning: array_keys() expects parameter 1 to be array, null given in /in/OSC0s on line 3 Warning: implode(): Invalid arguments passed in /in/OSC0s on line 3 Foo | Déja vu | Déja vu |
Output for 5.2.5 - 5.2.17
Warning: Wrong parameter count for array_fill() in /in/OSC0s on line 3 Warning: array_keys(): The first argument should be an array in /in/OSC0s on line 3 Warning: implode(): Invalid arguments passed in /in/OSC0s on line 3 Foo | Déja vu | Déja vu |
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.2.4
Warning: Wrong parameter count for array_fill() in /in/OSC0s on line 3 Warning: array_keys(): The first argument should be an array in /in/OSC0s on line 3 Warning: implode(): Bad arguments. in /in/OSC0s on line 3 Foo | Déja vu | Déja vu |
Output for 4.3.2 - 4.3.9, 5.0.0 - 5.0.1
Warning: Wrong parameter count for array_fill() in /in/OSC0s on line 3 Warning: array_keys(): The first argument should be an array in /in/OSC0s on line 3 Warning: implode(): Bad arguments. in /in/OSC0s on line 3 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/OSC0s on line 4 Foo |PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/OSC0s on line 5 Déja vu |PHP_EOLDéja vu |
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for array_fill() in /in/OSC0s on line 3 Warning: array_keys() [http://www.php.net/function.array-keys]: The first argument should be an array in /in/OSC0s on line 3 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/OSC0s on line 3 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/OSC0s on line 4 Foo |PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/OSC0s on line 5 Déja vu |PHP_EOLDéja vu |