3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $v = '10155674128355111'; echo $v % 6 . PHP_EOL; while (strlen($v) > 9) { $short = substr($v, 0, 9); $prefix = (int)$short % 6; $v = $prefix . substr($v, 9); echo "SHORT: ". $short . " PREFIX: ". $prefix . " NUMBER: ". $v . PHP_EOL; } echo $v % 6;
based on JlPW8
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.3.0rc4
5 SHORT: 101556741 PREFIX: 3 NUMBER: 328355111 5
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/dgr1M on line 5 5PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/dgr1M on line 15 SHORT: 101556741 PREFIX: 3 NUMBER: 328355111PHP_EOL5