MO::get_byteorder() WordPress Method

The MO::get_byteorder() method is used to get the byte order of a machine.

MO::get_byteorder( int $magic ) #


Parameters

$magic

(int)(Required)


Top ↑

Return

(string|false)


Top ↑

Source

File: wp-includes/pomo/mo.php

		public function get_byteorder( $magic ) {
			// The magic is 0x950412de.

			// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
			$magic_little    = (int) - 1794895138;
			$magic_little_64 = (int) 2500072158;
			// 0xde120495
			$magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF;
			if ( $magic_little == $magic || $magic_little_64 == $magic ) {
				return 'little';
			} elseif ( $magic_big == $magic ) {
				return 'big';
			} else {
				return false;
			}
		}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.