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-- Test session_start() function : variation --EXTENSIONS-- session --SKIPIF-- <?php..

Decoded Output download

--TEST--
Test session_start() function : variation
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

echo "*** Testing session_start() : variation ***
";

session_start();

$_SESSION['colour'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['person'] = 'julia';
$_SESSION['age'] = 6;

var_dump($_SESSION);
var_dump(session_write_close());
var_dump($_SESSION);
session_start();
var_dump($_SESSION);

session_destroy();
echo "Done";
ob_end_flush();
?>
--EXPECT--
*** Testing session_start() : variation ***
array(4) {
  ["colour"]=>
  string(5) "green"
  ["animal"]=>
  string(3) "cat"
  ["person"]=>
  string(5) "julia"
  ["age"]=>
  int(6)
}
bool(true)
array(4) {
  ["colour"]=>
  string(5) "green"
  ["animal"]=>
  string(3) "cat"
  ["person"]=>
  string(5) "julia"
  ["age"]=>
  int(6)
}
array(4) {
  ["colour"]=>
  string(5) "green"
  ["animal"]=>
  string(3) "cat"
  ["person"]=>
  string(5) "julia"
  ["age"]=>
  int(6)
}
Done

Did this file decode correctly?

Original Code

--TEST--
Test session_start() function : variation
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

echo "*** Testing session_start() : variation ***\n";

session_start();

$_SESSION['colour'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['person'] = 'julia';
$_SESSION['age'] = 6;

var_dump($_SESSION);
var_dump(session_write_close());
var_dump($_SESSION);
session_start();
var_dump($_SESSION);

session_destroy();
echo "Done";
ob_end_flush();
?>
--EXPECT--
*** Testing session_start() : variation ***
array(4) {
  ["colour"]=>
  string(5) "green"
  ["animal"]=>
  string(3) "cat"
  ["person"]=>
  string(5) "julia"
  ["age"]=>
  int(6)
}
bool(true)
array(4) {
  ["colour"]=>
  string(5) "green"
  ["animal"]=>
  string(3) "cat"
  ["person"]=>
  string(5) "julia"
  ["age"]=>
  int(6)
}
array(4) {
  ["colour"]=>
  string(5) "green"
  ["animal"]=>
  string(3) "cat"
  ["person"]=>
  string(5) "julia"
  ["age"]=>
  int(6)
}
Done

Function Calls

None

Variables

None

Stats

MD5 2eca4262ee6223d3a0b640a95b5923e4
Eval Count 0
Decode Time 85 ms