1--TEST-- 2Surprising result with integer literals (hex/octal) 3--EXTENSIONS-- 4filter 5--FILE-- 6<?php 7echo 'Hex', \PHP_EOL; 8var_dump(filter_var('0x', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX)); 9var_dump(filter_var('0xg', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX)); 10var_dump(filter_var('0X', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX)); 11var_dump(filter_var('0Xg', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX)); 12var_dump(filter_var('', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX)); 13echo 'Octal', \PHP_EOL; 14var_dump(filter_var('0o', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 15var_dump(filter_var('0og', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 16var_dump(filter_var('0O', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 17var_dump(filter_var('0Og', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 18var_dump(filter_var('O', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 19var_dump(filter_var('Og', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 20var_dump(filter_var('', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); 21?> 22--EXPECT-- 23Hex 24bool(false) 25bool(false) 26bool(false) 27bool(false) 28bool(false) 29Octal 30bool(false) 31bool(false) 32bool(false) 33bool(false) 34bool(false) 35bool(false) 36bool(false) 37