Lines Matching refs:str
36 * @param string $str String number literal (decimal, octal, hex or binary)
42 …public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = f… argument
43 $attributes['rawValue'] = $str;
45 $str = str_replace('_', '', $str);
47 if ('0' !== $str[0] || '0' === $str) {
49 return new Int_((int) $str, $attributes);
52 if ('x' === $str[1] || 'X' === $str[1]) {
54 return new Int_(hexdec($str), $attributes);
57 if ('b' === $str[1] || 'B' === $str[1]) {
59 return new Int_(bindec($str), $attributes);
62 if (!$allowInvalidOctal && strpbrk($str, '89')) {
67 if ('o' === $str[1] || 'O' === $str[1]) {
68 $str = substr($str, 2);
73 return new Int_(intval($str, 8), $attributes);