Find the element at Index 4
$ index = 4 ; echo ( " Element ▁ at ▁ index ▁ " . $ index . " ▁ is ▁ " . getElement ( $ arr , $ index ) . " STRNEWLINE " ) ; $ l = 0 ; $ r = 3 ; $ val = 4 ; update ( $ arr , $ l , $ r , $ val ) ;