Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- substr_replace() function - array with unset --FILE-- <?php $replacement = ['A',..

Decoded Output download

--TEST--
substr_replace() function - array with unset
--FILE--
<?php

$replacement = ['A', 'C', 'B'];
unset($replacement[1]);
$newarr = substr_replace(['1 string', '2 string'], $replacement, 0);
print_r($newarr);

$replacement = ['foo', 42 => 'bar', 'baz'];
unset($replacement[42]);
$newarr = substr_replace(['1 string', '2 string'], $replacement, 0);
print_r($newarr);

?>
--EXPECT--
Array
(
    [0] => A
    [1] => B
)
Array
(
    [0] => foo
    [1] => baz
)

Did this file decode correctly?

Original Code

--TEST--
substr_replace() function - array with unset
--FILE--
<?php

$replacement = ['A', 'C', 'B'];
unset($replacement[1]);
$newarr = substr_replace(['1 string', '2 string'], $replacement, 0);
print_r($newarr);

$replacement = ['foo', 42 => 'bar', 'baz'];
unset($replacement[42]);
$newarr = substr_replace(['1 string', '2 string'], $replacement, 0);
print_r($newarr);

?>
--EXPECT--
Array
(
    [0] => A
    [1] => B
)
Array
(
    [0] => foo
    [1] => baz
)

Function Calls

None

Variables

None

Stats

MD5 a9b2cd8f8aaa742dd53dd89dad018c7d
Eval Count 0
Decode Time 92 ms