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-- Bug #43541 (length parameter omitted or not does not work when casted to float) -..

Decoded Output download

--TEST--
Bug #43541 (length parameter omitted or not does not work when casted to float)
--FILE--
<?php
$arr = array(1, 2, 3, 4, 5, 6);

var_dump(array_slice($arr, 0, (float)2));
var_dump(array_slice($arr, 0, (int)2));
?>
--EXPECT--
array(2) {
  [0]=>
  int(1)
  [1]=>
  int(2)
}
array(2) {
  [0]=>
  int(1)
  [1]=>
  int(2)
}

Did this file decode correctly?

Original Code

--TEST--
Bug #43541 (length parameter omitted or not does not work when casted to float)
--FILE--
<?php
$arr = array(1, 2, 3, 4, 5, 6);

var_dump(array_slice($arr, 0, (float)2));
var_dump(array_slice($arr, 0, (int)2));
?>
--EXPECT--
array(2) {
  [0]=>
  int(1)
  [1]=>
  int(2)
}
array(2) {
  [0]=>
  int(1)
  [1]=>
  int(2)
}

Function Calls

None

Variables

$arr [{'key': 0, 'value': 1}, {'key': 1, 'value': 2}, {'key': 2, 'value': 3}, {'key': 3, 'value': 4}, {'key': 4, 'value': 5}, {'key': 5, 'value': 6}]

Stats

MD5 04827b0f2537ca5a581a97315958b185
Eval Count 0
Decode Time 80 ms