示例#1
0
 /**
  * Resolves if the machine arquitecture is big or little endian by comparing two binary packed
  * values
  */
 public static function isLittleEndian()
 {
     if (!is_null(self::$littleEndian)) {
         return self::$littleEndian;
     }
     $machineLong = pack("L", 1);
     // Machine dependent
     $indepLong = pack("N", 1);
     // Machine independent
     self::$littleEndian = $machineLong[0] != $indepLong[0];
     return self::$littleEndian;
 }