Does anyone know how to pass an octal value to a function
successfully?
I am trying to create a class to handle directory permissions but
passing the permission settings is going nowhere.
Octals seem to automatically get converted to decimal when sent and
when trying to convert back using decoct the 0 is dropped.
I have also tried sending as a string but chmod() does not accept
string input and I haven't been able to convert back to a number &
retain the leading 0.
Thanks
sample.
test(0777);
function test($myvar){
echo "PASSED VAL:".$myvar;
// PASSED VAL:511
echo "DECOCT:".decoct($myvar);
// DECOCT:777
echo "STRING:".(('0'.decoct($myvar))*1);
// STRING:777