3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $val = 'DANIEL123'; var_dump($val); $val = str_pad($val, (16 * ( floor(strlen($val) / 16) + ( strlen($val) % 16 == 0 ? 2 : 1 ) ) ), chr(16 - (strlen($val) % 16) ) ); for ($i=0; $i<strlen($val); $i++) { $char = $val[$i]; var_dump($char); var_dump(ord($char)); } $lc = strlen($dec) - 1; return rtrim($dec, ( ( ord($dec[$lc]) >= 0 and ord($dec[$lc]) <= 16 ) ? $dec[$lc] : null));
based on hoKIA
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
string(9) "DANIEL123" string(1) "D" int(68) string(1) "A" int(65) string(1) "N" int(78) string(1) "I" int(73) string(1) "E" int(69) string(1) "L" int(76) string(1) "1" int(49) string(1) "2" int(50) string(1) "3" int(51) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) Notice: Undefined variable: dec in /in/uXA0u on line 23 Notice: Undefined variable: dec in /in/uXA0u on line 24 Notice: Undefined variable: dec in /in/uXA0u on line 26 Notice: Undefined variable: dec in /in/uXA0u on line 28 Notice: Undefined variable: dec in /in/uXA0u on line 30
Output for hhvm-3.22.0
string(9) "DANIEL123" string(1) "D" int(68) string(1) "A" int(65) string(1) "N" int(78) string(1) "I" int(73) string(1) "E" int(69) string(1) "L" int(76) string(1) "1" int(49) string(1) "2" int(50) string(1) "3" int(51) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) Notice: Undefined variable: dec in /in/uXA0u on line -1 Notice: Undefined variable: dec in /in/uXA0u on line -1 Notice: Undefined variable: dec in /in/uXA0u on line -1 Notice: Undefined variable: dec in /in/uXA0u on line -1 Notice: Undefined variable: dec in /in/uXA0u on line -1
Output for hhvm-3.21.3
string(9) "DANIEL123" string(1) "D" int(68) string(1) "A" int(65) string(1) "N" int(78) string(1) "I" int(73) string(1) "E" int(69) string(1) "L" int(76) string(1) "1" int(49) string(1) "2" int(50) string(1) "3" int(51) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) Notice: Undefined variable: dec in /in/uXA0u on line 23 Notice: Undefined variable: dec in /in/uXA0u on line 31 Notice: Undefined variable: dec in /in/uXA0u on line 26 Notice: Undefined variable: dec in /in/uXA0u on line 28 Notice: Undefined variable: dec in /in/uXA0u on line 30
Output for hhvm-3.18.5
string(9) "DANIEL123" string(1) "D" int(68) string(1) "A" int(65) string(1) "N" int(78) string(1) "I" int(73) string(1) "E" int(69) string(1) "L" int(76) string(1) "1" int(49) string(1) "2" int(50) string(1) "3" int(51) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) string(1) "" int(7) Notice: Undefined variable: dec in /in/uXA0u on line 23 Notice: Undefined variable: dec in /in/uXA0u on line 31 Notice: Undefined variable: dec in /in/uXA0u on line 26 Warning: ord() expects parameter 1 to be string, null given in /in/uXA0u on line 26 Notice: Undefined variable: dec in /in/uXA0u on line 28 Warning: ord() expects parameter 1 to be string, null given in /in/uXA0u on line 28 Notice: Undefined variable: dec in /in/uXA0u on line 30 Warning: rtrim() expects parameter 1 to be string, null given in /in/uXA0u on line 31