Code Duplication    Length = 7-8 lines in 3 locations

src/wp-includes/class-json.php 3 locations

@@ 813-819 (lines=7) @@
810
                            array_pop($stk);
811
                            //print("Found end of string at {$c}: ".$this->substr8($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
812
813
                        } elseif (($chrs{$c} == '[') &&
814
                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
815
                            // found a left-bracket, and we are in an array, object, or slice
816
                            array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
817
                            //print("Found start of array at {$c}\n");
818
819
                        } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
820
                            // found a right-bracket, and we're in an array
821
                            array_pop($stk);
822
                            //print("Found end of array at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
@@ 824-830 (lines=7) @@
821
                            array_pop($stk);
822
                            //print("Found end of array at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
823
824
                        } elseif (($chrs{$c} == '{') &&
825
                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
826
                            // found a left-brace, and we are in an array, object, or slice
827
                            array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
828
                            //print("Found start of object at {$c}\n");
829
830
                        } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
831
                            // found a right-brace, and we're in an object
832
                            array_pop($stk);
833
                            //print("Found end of object at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
@@ 835-842 (lines=8) @@
832
                            array_pop($stk);
833
                            //print("Found end of object at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
834
835
                        } elseif (($substr_chrs_c_2 == '/*') &&
836
                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
837
                            // found a comment start, and we are in an array, object, or slice
838
                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
839
                            $c++;
840
                            //print("Found start of comment at {$c}\n");
841
842
                        } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
843
                            // found a comment end, and we're in one now
844
                            array_pop($stk);
845
                            $c++;