CodeIgniter version: develop (4a4f55b) after 4.3.1
This is also reported in #2962
<?phpnamespaceApp\Controllers;
useCodeIgniter\HTTP\URI;
class Home extends BaseController
{
publicfunctionindex()
{
$uri = newURI('http://example.com/one/two');
$uri->setSegment(4, 'four');
var_dump($uri->getSegments());
echo$uri;
}
}The result:
array (size=3)
0 => string 'one' (length=3)
1 => string 'two' (length=3)
2 => string 'four' (length=4)
http://example.com/one/two/four
CodeIgniter version: develop (4a4f55b) after 4.3.1
This is also reported in #2962
The result: