3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(intval('0777')); var_dump(intval('777')); var_dump('----------------------'); var_dump(intval('0777', 0)); var_dump(intval('777', 0)); var_dump('----------------------'); var_dump(intval('0777', 8)); var_dump(intval('777', 8)); var_dump('----------------------'); var_dump(intval(0777, 8)); var_dump(intval(777, 8)); var_dump('----------------------'); var_dump(intval((string)0777, 8)); var_dump(intval((string)777, 8)); var_dump('done.');
based on YmI8H
Output for 4.3.0 - 7.2.6
int(777) int(777) string(22) "----------------------" int(511) int(777) string(22) "----------------------" int(511) int(511) string(22) "----------------------" int(511) int(777) string(22) "----------------------" int(329) int(511) string(5) "done."