@@ -88,10 +88,10 @@ function table_var_dump($variable) {
8888 $ variable = str_replace (chr (0 ), ' ' , $ variable );
8989 $ varlen = strlen ($ variable );
9090 for ($ i = 0 ; $ i < $ varlen ; $ i ++) {
91- if (preg_match ('#[ ' .chr (0x0A ).chr (0x0D ).' -;0-9A-Za-z]# ' , $ variable{ $ i } )) {
92- $ returnstring .= $ variable{ $ i } ;
91+ if (preg_match ('#[ ' .chr (0x0A ).chr (0x0D ).' -;0-9A-Za-z]# ' , $ variable[ $ i ] )) {
92+ $ returnstring .= $ variable[ $ i ] ;
9393 } else {
94- $ returnstring .= '&# ' .str_pad (ord ($ variable{ $ i } ), 3 , '0 ' , STR_PAD_LEFT ).'; ' ;
94+ $ returnstring .= '&# ' .str_pad (ord ($ variable[ $ i ] ), 3 , '0 ' , STR_PAD_LEFT ).'; ' ;
9595 }
9696 }
9797 $ returnstring = nl2br ($ returnstring );
@@ -242,19 +242,19 @@ function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) {
242242 // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
243243 if (strpos ($ binarypointnumber , '. ' ) === false ) {
244244 $ binarypointnumber = '0. ' .$ binarypointnumber ;
245- } elseif ($ binarypointnumber{ 0 } == '. ' ) {
245+ } elseif ($ binarypointnumber[ 0 ] == '. ' ) {
246246 $ binarypointnumber = '0 ' .$ binarypointnumber ;
247247 }
248248 $ exponent = 0 ;
249- while (($ binarypointnumber{ 0 } != '1 ' ) || (substr ($ binarypointnumber , 1 , 1 ) != '. ' )) {
249+ while (($ binarypointnumber[ 0 ] != '1 ' ) || (substr ($ binarypointnumber , 1 , 1 ) != '. ' )) {
250250 if (substr ($ binarypointnumber , 1 , 1 ) == '. ' ) {
251251 $ exponent --;
252252 $ binarypointnumber = substr ($ binarypointnumber , 2 , 1 ).'. ' .substr ($ binarypointnumber , 3 );
253253 } else {
254254 $ pointpos = strpos ($ binarypointnumber , '. ' );
255255 $ exponent += ($ pointpos - 1 );
256256 $ binarypointnumber = str_replace ('. ' , '' , $ binarypointnumber );
257- $ binarypointnumber = $ binarypointnumber{ 0 } .'. ' .substr ($ binarypointnumber , 1 );
257+ $ binarypointnumber = $ binarypointnumber[ 0 ] .'. ' .substr ($ binarypointnumber , 1 );
258258 }
259259 }
260260 $ binarypointnumber = str_pad (substr ($ binarypointnumber , 0 , $ maxbits + 2 ), $ maxbits + 2 , '0 ' , STR_PAD_RIGHT );
@@ -324,7 +324,7 @@ function BigEndian2Float($byteword) {
324324 // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html
325325
326326 $ bitword = BigEndian2Bin ($ byteword );
327- $ signbit = $ bitword{ 0 } ;
327+ $ signbit = $ bitword[ 0 ] ;
328328
329329 switch (strlen ($ byteword ) * 8 ) {
330330 case 32 :
@@ -397,9 +397,9 @@ function BigEndian2Int($byteword, $synchsafe=false, $signed=false) {
397397 $ bytewordlen = strlen ($ byteword );
398398 for ($ i = 0 ; $ i < $ bytewordlen ; $ i ++) {
399399 if ($ synchsafe ) { // disregard MSB, effectively 7-bit bytes
400- $ intvalue = $ intvalue | (ord ($ byteword{ $ i } ) & 0x7F ) << (($ bytewordlen - 1 - $ i ) * 7 );
400+ $ intvalue = $ intvalue | (ord ($ byteword[ $ i ] ) & 0x7F ) << (($ bytewordlen - 1 - $ i ) * 7 );
401401 } else {
402- $ intvalue += ord($ byteword{ $ i } ) * pow (256 , ($ bytewordlen - 1 - $ i ));
402+ $ intvalue += ord ($ byteword[ $ i ] ) * pow (256 , ($ bytewordlen - 1 - $ i ));
403403 }
404404 }
405405 if ($ signed && !$ synchsafe ) {
@@ -435,7 +435,7 @@ function BigEndian2Bin($byteword) {
435435 $ binvalue = '' ;
436436 $ bytewordlen = strlen ($ byteword );
437437 for ($ i = 0 ; $ i < $ bytewordlen ; $ i ++) {
438- $ binvalue .= str_pad(decbin(ord ($ byteword{ $ i } )), 8 , '0 ' , STR_PAD_LEFT );
438+ $ binvalue .= str_pad (decbin (ord ($ byteword[ $ i ] )), 8 , '0 ' , STR_PAD_LEFT );
439439 }
440440 return $ binvalue ;
441441 }
@@ -562,7 +562,7 @@ function Unsynchronise($data) {
562562 $ data = str_replace (chr (0xFF ).chr (0x00 ), chr (0xFF ).chr (0x00 ).chr (0x00 ), $ data );
563563 $ unsyncheddata = '' ;
564564 for ($ i = 0 ; $ i < strlen ($ data ); $ i ++) {
565- $ thischar = $ data{ $ i } ;
565+ $ thischar = $ data[ $ i ] ;
566566 $ unsyncheddata .= $ thischar ;
567567 if ($ thischar == chr (255 )) {
568568 $ nextchar = ord (substr ($ data , $ i + 1 , 1 ));
@@ -677,8 +677,8 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
677677 $ asciidata = substr ($ asciidata , 0 , strlen ($ asciidata ) - 2 ); // remove terminator, only if present (it should be, but...)
678678 }
679679 for ($ i = 0 ; $ i < strlen ($ asciidata ); $ i += 2 ) {
680- if ((ord ($ asciidata{ $ i } ) <= 0x7F ) || (ord ($ asciidata{ $ i } ) >= 0xA0 )) {
681- $ tempstring .= $ asciidata{ $ i } ;
680+ if ((ord ($ asciidata[ $ i ] ) <= 0x7F ) || (ord ($ asciidata[ $ i ] ) >= 0xA0 )) {
681+ $ tempstring .= $ asciidata[ $ i ] ;
682682 } else {
683683 $ tempstring .= '? ' ;
684684 }
@@ -692,8 +692,8 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
692692 $ asciidata = substr ($ asciidata , 0 , strlen ($ asciidata ) - 2 ); // remove terminator, only if present (it should be, but...)
693693 }
694694 for ($ i = 0 ; $ i < strlen ($ asciidata ); $ i += 2 ) {
695- if ((ord ($ asciidata{ $ i } ) <= 0x7F ) || (ord ($ asciidata{ $ i } ) >= 0xA0 )) {
696- $ tempstring .= $ asciidata{ $ i } ;
695+ if ((ord ($ asciidata[ $ i ] ) <= 0x7F ) || (ord ($ asciidata[ $ i ] ) >= 0xA0 )) {
696+ $ tempstring .= $ asciidata[ $ i ] ;
697697 } else {
698698 $ tempstring .= '? ' ;
699699 }
@@ -711,8 +711,8 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
711711 $ asciidata = substr ($ asciidata , 0 , strlen ($ asciidata ) - 2 ); // remove terminator, only if present (it should be, but...)
712712 }
713713 for ($ i = 0 ; ($ i + 1 ) < strlen ($ asciidata ); $ i += 2 ) {
714- if ((ord ($ asciidata{ ($ i + 1 )} ) <= 0x7F ) || (ord ($ asciidata{ ($ i + 1 )} ) >= 0xA0 )) {
715- $ tempstring .= $ asciidata{ ($ i + 1 )} ;
714+ if ((ord ($ asciidata[ ($ i + 1 )] ) <= 0x7F ) || (ord ($ asciidata[ ($ i + 1 )] ) >= 0xA0 )) {
715+ $ tempstring .= $ asciidata[ ($ i + 1 )] ;
716716 } else {
717717 $ tempstring .= '? ' ;
718718 }
@@ -850,26 +850,26 @@ function GUIDtoBytestring($GUIDstring) {
850850
851851if (!function_exists ('BytestringToGUID ' )) {
852852 function BytestringToGUID ($ Bytestring ) {
853- $ GUIDstring = str_pad(dechex (ord ($ Bytestring{ 3 } )), 2 , '0 ' , STR_PAD_LEFT );
854- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 2 } )), 2 , '0 ' , STR_PAD_LEFT );
855- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 1 } )), 2 , '0 ' , STR_PAD_LEFT );
856- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 0 } )), 2 , '0 ' , STR_PAD_LEFT );
853+ $ GUIDstring = str_pad (dechex (ord ($ Bytestring[ 3 ] )), 2 , '0 ' , STR_PAD_LEFT );
854+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 2 ] )), 2 , '0 ' , STR_PAD_LEFT );
855+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 1 ] )), 2 , '0 ' , STR_PAD_LEFT );
856+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 0 ] )), 2 , '0 ' , STR_PAD_LEFT );
857857 $ GUIDstring .= '- ' ;
858- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 5 } )), 2 , '0 ' , STR_PAD_LEFT );
859- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 4 } )), 2 , '0 ' , STR_PAD_LEFT );
858+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 5 ] )), 2 , '0 ' , STR_PAD_LEFT );
859+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 4 ] )), 2 , '0 ' , STR_PAD_LEFT );
860860 $ GUIDstring .= '- ' ;
861- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 7 } )), 2 , '0 ' , STR_PAD_LEFT );
862- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 6 } )), 2 , '0 ' , STR_PAD_LEFT );
861+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 7 ] )), 2 , '0 ' , STR_PAD_LEFT );
862+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 6 ] )), 2 , '0 ' , STR_PAD_LEFT );
863863 $ GUIDstring .= '- ' ;
864- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 8 } )), 2 , '0 ' , STR_PAD_LEFT );
865- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 9 } )), 2 , '0 ' , STR_PAD_LEFT );
864+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 8 ] )), 2 , '0 ' , STR_PAD_LEFT );
865+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 9 ] )), 2 , '0 ' , STR_PAD_LEFT );
866866 $ GUIDstring .= '- ' ;
867- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 10 } )), 2 , '0 ' , STR_PAD_LEFT );
868- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 11 } )), 2 , '0 ' , STR_PAD_LEFT );
869- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 12 } )), 2 , '0 ' , STR_PAD_LEFT );
870- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 13 } )), 2 , '0 ' , STR_PAD_LEFT );
871- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 14 } )), 2 , '0 ' , STR_PAD_LEFT );
872- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 15 } )), 2 , '0 ' , STR_PAD_LEFT );
867+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 10 ] )), 2 , '0 ' , STR_PAD_LEFT );
868+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 11 ] )), 2 , '0 ' , STR_PAD_LEFT );
869+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 12 ] )), 2 , '0 ' , STR_PAD_LEFT );
870+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 13 ] )), 2 , '0 ' , STR_PAD_LEFT );
871+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 14 ] )), 2 , '0 ' , STR_PAD_LEFT );
872+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 15 ] )), 2 , '0 ' , STR_PAD_LEFT );
873873
874874 return strtoupper ($ GUIDstring );
875875 }
@@ -940,17 +940,17 @@ function utf8_decode($utf8text) {
940940 $ utf8length = strlen ($ utf8text );
941941 $ decodedtext = '' ;
942942 for ($ i = 0 ; $ i < $ utf8length ; $ i ++) {
943- if ((ord ($ utf8text{ $ i } ) & 0x80 ) == 0 ) {
944- $ decodedtext .= $ utf8text{ $ i } ;
945- } elseif ((ord ($ utf8text{ $ i } ) & 0xF0 ) == 0xF0 ) {
943+ if ((ord ($ utf8text[ $ i ] ) & 0x80 ) == 0 ) {
944+ $ decodedtext .= $ utf8text[ $ i ] ;
945+ } elseif ((ord ($ utf8text[ $ i ] ) & 0xF0 ) == 0xF0 ) {
946946 $ decodedtext .= '? ' ;
947947 $ i += 3 ;
948- } elseif ((ord ($ utf8text{ $ i } ) & 0xE0 ) == 0xE0 ) {
948+ } elseif ((ord ($ utf8text[ $ i ] ) & 0xE0 ) == 0xE0 ) {
949949 $ decodedtext .= '? ' ;
950950 $ i += 2 ;
951- } elseif ((ord ($ utf8text{ $ i } ) & 0xC0 ) == 0xC0 ) {
951+ } elseif ((ord ($ utf8text[ $ i ] ) & 0xC0 ) == 0xC0 ) {
952952 // 2 11 110bbbbb 10bbbbbb
953- $ decodedchar = Bin2Dec (substr (Dec2Bin (ord ($ utf8text{ $ i } )), 3 , 5 ).substr (Dec2Bin (ord ($ utf8text{ ($ i + 1 )} )), 2 , 6 ));
953+ $ decodedchar = Bin2Dec (substr (Dec2Bin (ord ($ utf8text[ $ i ] )), 3 , 5 ).substr (Dec2Bin (ord ($ utf8text[ ($ i + 1 )] )), 2 , 6 ));
954954 if ($ decodedchar <= 255 ) {
955955 $ decodedtext .= chr ($ decodedchar );
956956 } else {
@@ -1068,7 +1068,7 @@ function CreateDeepArray($ArrayPath, $Separator, $Value) {
10681068 // $foo = array('path'=>array('to'=>'array('my'=>array('file.txt'))));
10691069 // or
10701070 // $foo['path']['to']['my'] = 'file.txt';
1071- while ($ ArrayPath{ 0 } == $ Separator ) {
1071+ while ($ ArrayPath[ 0 ] == $ Separator ) {
10721072 $ ArrayPath = substr ($ ArrayPath , 1 );
10731073 }
10741074 if (($ pos = strpos ($ ArrayPath , $ Separator )) !== false ) {
@@ -1916,7 +1916,7 @@ function decodeMPEGaudioHeader($fd, $offset, &$ThisFileInfo, $recursivesearch=tr
19161916 if ($ ThisFileInfo ['mpeg ' ]['audio ' ]['xing_flags ' ]['toc ' ]) {
19171917 $ LAMEtocData = substr ($ headerstring , $ VBRidOffset + 16 , 100 );
19181918 for ($ i = 0 ; $ i < 100 ; $ i ++) {
1919- $ ThisFileInfo ['mpeg ' ]['audio ' ]['toc ' ][$ i ] = ord ($ LAMEtocData{ $ i } );
1919+ $ ThisFileInfo ['mpeg ' ]['audio ' ]['toc ' ][$ i ] = ord ($ LAMEtocData[ $ i ] );
19201920 }
19211921 }
19221922 if ($ ThisFileInfo ['mpeg ' ]['audio ' ]['xing_flags ' ]['vbr_scale ' ]) {
@@ -2297,9 +2297,9 @@ function FreeFormatFrameLength($fd, $offset, &$ThisFileInfo, $deepscan=false) {
22972297
22982298 $ SyncPattern1 = substr ($ MPEGaudioData , 0 , 4 );
22992299 // may be different pattern due to padding
2300- $ SyncPattern2 = $ SyncPattern1{ 0 } .$ SyncPattern1{ 1 } .chr (ord ($ SyncPattern1{ 2 } ) | 0x02 ).$ SyncPattern1{ 3 } ;
2300+ $ SyncPattern2 = $ SyncPattern1[ 0 ] .$ SyncPattern1[ 1 ] .chr (ord ($ SyncPattern1[ 2 ] ) | 0x02 ).$ SyncPattern1[ 3 ] ;
23012301 if ($ SyncPattern2 === $ SyncPattern1 ) {
2302- $ SyncPattern2 = $ SyncPattern1{ 0 } .$ SyncPattern1{ 1 } .chr (ord ($ SyncPattern1{ 2 } ) & 0xFD ).$ SyncPattern1{ 3 } ;
2302+ $ SyncPattern2 = $ SyncPattern1[ 0 ] .$ SyncPattern1[ 1 ] .chr (ord ($ SyncPattern1[ 2 ] ) & 0xFD ).$ SyncPattern1[ 3 ] ;
23032303 }
23042304
23052305 $ framelength = false ;
@@ -2435,7 +2435,7 @@ function getOnlyMPEGaudioInfo($fd, &$ThisFileInfo, $avdataoffset, $BitrateHistog
24352435 return false ;
24362436 }
24372437
2438- if (($ header{ $ SynchSeekOffset} == CONST_FF ) && ($ header{ ($ SynchSeekOffset + 1 )} > CONST_E0 )) { // synch detected
2438+ if (($ header[ $ SynchSeekOffset] == CONST_FF ) && ($ header[ ($ SynchSeekOffset + 1 )] > CONST_E0 )) { // synch detected
24392439
24402440 if (!isset ($ FirstFrameThisfileInfo ) && !isset ($ ThisFileInfo ['mpeg ' ]['audio ' ])) {
24412441 $ FirstFrameThisfileInfo = $ ThisFileInfo ;
@@ -2764,18 +2764,18 @@ function MPEGaudioHeaderDecode($Header4Bytes) {
27642764 }
27652765
27662766 $ MPEGrawHeader ['synch ' ] = (BigEndian2Int (substr ($ Header4Bytes , 0 , 2 )) & 0xFFE0 ) >> 4 ;
2767- $ MPEGrawHeader ['version ' ] = (ord ($ Header4Bytes{ 1 } ) & 0x18 ) >> 3 ; // BB
2768- $ MPEGrawHeader ['layer ' ] = (ord ($ Header4Bytes{ 1 } ) & 0x06 ) >> 1 ; // CC
2769- $ MPEGrawHeader ['protection ' ] = (ord ($ Header4Bytes{ 1 } ) & 0x01 ); // D
2770- $ MPEGrawHeader ['bitrate ' ] = (ord ($ Header4Bytes{ 2 } ) & 0xF0 ) >> 4 ; // EEEE
2771- $ MPEGrawHeader ['sample_rate ' ] = (ord ($ Header4Bytes{ 2 } ) & 0x0C ) >> 2 ; // FF
2772- $ MPEGrawHeader ['padding ' ] = (ord ($ Header4Bytes{ 2 } ) & 0x02 ) >> 1 ; // G
2773- $ MPEGrawHeader ['private ' ] = (ord ($ Header4Bytes{ 2 } ) & 0x01 ); // H
2774- $ MPEGrawHeader ['channelmode ' ] = (ord ($ Header4Bytes{ 3 } ) & 0xC0 ) >> 6 ; // II
2775- $ MPEGrawHeader ['modeextension ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x30 ) >> 4 ; // JJ
2776- $ MPEGrawHeader ['copyright ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x08 ) >> 3 ; // K
2777- $ MPEGrawHeader ['original ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x04 ) >> 2 ; // L
2778- $ MPEGrawHeader ['emphasis ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x03 ); // MM
2767+ $ MPEGrawHeader ['version ' ] = (ord ($ Header4Bytes[ 1 ] ) & 0x18 ) >> 3 ; // BB
2768+ $ MPEGrawHeader ['layer ' ] = (ord ($ Header4Bytes[ 1 ] ) & 0x06 ) >> 1 ; // CC
2769+ $ MPEGrawHeader ['protection ' ] = (ord ($ Header4Bytes[ 1 ] ) & 0x01 ); // D
2770+ $ MPEGrawHeader ['bitrate ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0xF0 ) >> 4 ; // EEEE
2771+ $ MPEGrawHeader ['sample_rate ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0x0C ) >> 2 ; // FF
2772+ $ MPEGrawHeader ['padding ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0x02 ) >> 1 ; // G
2773+ $ MPEGrawHeader ['private ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0x01 ); // H
2774+ $ MPEGrawHeader ['channelmode ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0xC0 ) >> 6 ; // II
2775+ $ MPEGrawHeader ['modeextension ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x30 ) >> 4 ; // JJ
2776+ $ MPEGrawHeader ['copyright ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x08 ) >> 3 ; // K
2777+ $ MPEGrawHeader ['original ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x04 ) >> 2 ; // L
2778+ $ MPEGrawHeader ['emphasis ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x03 ); // MM
27792779
27802780 return $ MPEGrawHeader ;
27812781}
0 commit comments