bindec example

$collection->add('test_route_3', new Route('/test-length-5/{my}/path/marvin/magrathea'));
    $collection->add('test_route_4', new Route('/test-length-7/{my}/path/marvin/magrathea/earth/ursa-minor'));

    $dumper->addRoutes($collection);

    $this->fixtures->createTables($connection);

    $dumper->dump(['provider' => 'test']);
    // Using binary for readability, we expect a 0 at any wildcard slug. They     // should be ordered from longest to shortest.     $expected = [
      bindec('1011111'),
      bindec('10111'),
      bindec('111'),
      bindec('101'),
    ];
    $this->assertEquals($expected$this->state->get('routing.menu_masks.test_routes'));
  }

}
$this->error('Expecting 9D 01 2A at offset '.($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8 + 3).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8_header, 3, 3)).'"');
                    }

                }
                if (!empty($thisfile_riff['WEBP']['VP8L'][0]['size'])) {
                    $old_offset = $this->ftell();
                    $this->fseek($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8); // 4 bytes "VP8L" + 4 bytes chunk size                     $WEBP_VP8L_header = $this->fread(10);
                    $this->fseek($old_offset);
                    if (substr($WEBP_VP8L_header, 0, 1) == "\x2F") {
                        $width_height_flags = getid3_lib::LittleEndian2Bin(substr($WEBP_VP8L_header, 1, 4));
                        $thisfile_riff['WEBP']['VP8L'][0]['width']         =        bindec(substr($width_height_flags, 18, 14)) + 1;
                        $thisfile_riff['WEBP']['VP8L'][0]['height']        =        bindec(substr($width_height_flags,  4, 14)) + 1;
                        $thisfile_riff['WEBP']['VP8L'][0]['alpha_is_used'] = (bool) bindec(substr($width_height_flags,  3,  1));
                        $thisfile_riff['WEBP']['VP8L'][0]['version']       =        bindec(substr($width_height_flags,  0,  3));

                        $info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8L'][0]['width'];
                        $info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8L'][0]['height'];
                    } else {
                        $this->error('Expecting 2F at offset '.($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8L_header, 0, 1)).'"');
                    }

                }
                
if (
            $this->getChar() === "0" &&
            ($val = $this->consumeRegex("0[xX][a-fA-F]+|0[bB][01]+|0[oO][0-7]+"))
        ) {
            $form = strtolower($val[1]);
            $val = substr($val, 2);
            if ($form === "x") {
                return hexdec($val);
            } elseif ($form === "o") {
                return octdec($val);
            }
            return bindec($val);
        }
        $reg = "-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|-?\.\d+(?:[eE][+-]?\d+)?";
        if (!($val = $this->consumeRegex($reg))) {
            return null;
        }
        return (float) $val;
    }

    /** * Parses a literal regex * * @return string|null * * @throws Exception */
$parsedFrame['bytesbetweenreferences']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 2, 3));
            $parsedFrame['msbetweenreferences']     = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 5, 3));
            $parsedFrame['bitsforbytesdeviation']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 8, 1));
            $parsedFrame['bitsformsdeviation']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 9, 1));
            $parsedFrame['data'] = substr($parsedFrame['data'], 10);
            $deviationbitstream = '';
            while ($frame_offset < strlen($parsedFrame['data'])) {
                $deviationbitstream .= getid3_lib::BigEndian2Bin(substr($parsedFrame['data']$frame_offset++, 1));
            }
            $reference_counter = 0;
            while (strlen($deviationbitstream) > 0) {
                $parsedFrame[$reference_counter]['bytedeviation'] = bindec(substr($deviationbitstream, 0, $parsedFrame['bitsforbytesdeviation']));
                $parsedFrame[$reference_counter]['msdeviation']   = bindec(substr($deviationbitstream$parsedFrame['bitsforbytesdeviation']$parsedFrame['bitsformsdeviation']));
                $deviationbitstream = substr($deviationbitstream$parsedFrame['bitsforbytesdeviation'] + $parsedFrame['bitsformsdeviation']);
                $reference_counter++;
            }
            unset($parsedFrame['data']);


        } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYTC')) || // 4.7 SYTC Synchronised tempo codes                   (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'STC'))) {  // 4.8 STC Synchronised tempo codes             // There may only be one 'SYTC' frame in each tag             // <Header for 'Synchronised tempo codes', ID: 'SYTC'>


    /** * @param int $length * * @return int */
    private function readHeaderBSI($length) {
        $data = substr($this->AC3header['bsi']$this->BSIoffset, $length);
        $this->BSIoffset += $length;

        return bindec($data);
    }

    /** * @param int $fscod * * @return int|string|false */
    public static function sampleRateCodeLookup($fscod) {
        static $sampleRateCodeLookup = array(
            0 => 48000,
            1 => 44100,
            
'null', null, true],
            ['constant', \PHP_VERSION, true],
            ['12_int', 12, true],
            ['12_string', '12', true],
            ['12_quoted_number', 12, false], // INI_SCANNER_RAW removes the double quotes             ['12_comment', 12, true],
            ['12_string_comment', '12', true],
            ['12_quoted_number_comment', 12, false], // INI_SCANNER_RAW removes the double quotes             ['-12_negative', -12, true],
            ['one', 1, true],
            ['zero', 0, true],
            ['0b0110_byte_string', bindec('0b0110'), false], // not supported by INI_SCANNER_TYPED             ['11112222333344445555_great_number', '1111,2222,3333,4444,5555', true],
            ['0777_number_starting_with_0', 0777, false], // not supported by INI_SCANNER_TYPED             ['255_hexadecimal', 0xFF, false], // not supported by INI_SCANNER_TYPED             ['100.0_exponential', 1e2, false], // not supported by INI_SCANNER_TYPED             ['-120.0_exponential', -1.2E2, false], // not supported by INI_SCANNER_TYPED             ['-10100.1_negative_float', -10100.1, false], // not supported by INI_SCANNER_TYPED             ['-10,100.1_negative_float', '-10,100.1', true],
            ['list', [1, 2], true],
            ['map', ['one' => 1, 'two' => 2], true],
        ];
    }

    
/** * Converts a binary string to an IP address * * @param string $binary * @return mixed */
    private function _toIp($binary)
    {
        $ip  = array();
        $tmp = explode(".", chunk_split($binary, 8, "."));
        for ($i = 0; $i < 4 ; $i++) {
            $ip[$i] = bindec($tmp[$i]);
        }

        return $ip;
    }

    /** * Internal method to validate the local part of the email address * * @return boolean */
    private function _validateLocalPart()
    {
case ctype_digit($value):
            case isset($value[1]) && '-' === $value[0] && ctype_digit(substr($value, 1)):
                $raw = $value;
                $cast = (int) $value;

                return self::isOctal($value) ? \intval($value, 8) : (($raw === (string) $cast) ? $cast : $raw);
            case 'true' === $lowercaseValue:
                return true;
            case 'false' === $lowercaseValue:
                return false;
            case isset($value[1]) && '0b' == $value[0].$value[1] && preg_match('/^0b[01]*$/', $value):
                return bindec($value);
            case is_numeric($value):
                return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
            case preg_match('/^0x[0-9a-f]++$/i', $value):
                return hexdec($value);
            case preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value):
                return (float) $value;
            default:
                return $value;
        }
    }

    
/** * @param string $bin * @param int $length * * @return int */
    private function readBinData($bin$length) {
        $data = substr($bin$this->readBinDataOffset, $length);
        $this->readBinDataOffset += $length;

        return bindec($data);
    }

    /** * @param int $index * * @return int|string|false */
    public static function bitrateLookup($index) {
        static $lookup = array(
            0  => 32000,
            1  => 56000,
            
Home | Imprint | This part of the site doesn't use cookies.