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 http_response_code basic functionality --CREDITS-- Gabriel Caruso (carusogab..

Decoded Output download

--TEST--
Test http_response_code basic functionality
--CREDITS--
Gabriel Caruso ([email protected])
--SKIPIF--
<?php
if (getenv('SKIP_REPEAT')) {
    /* The http_response_code leaks across repeats. Technically that's a bug, but it's something
     * that only affects the CLI repeat option, where the response code is not meaningful in the
     * first place. Other SAPIs will properly reset the response code for each request. */
    die('skip Not repeatable');
}
?>
--FILE--
<?php
var_dump(
    // Get the current default response code
    http_response_code(),
    // Set a response code
    http_response_code(201),
    // Get the new response code
    http_response_code()
);
?>
--EXPECT--
bool(false)
bool(true)
int(201)

Did this file decode correctly?

Original Code

--TEST--
Test http_response_code basic functionality
--CREDITS--
Gabriel Caruso ([email protected])
--SKIPIF--
<?php
if (getenv('SKIP_REPEAT')) {
    /* The http_response_code leaks across repeats. Technically that's a bug, but it's something
     * that only affects the CLI repeat option, where the response code is not meaningful in the
     * first place. Other SAPIs will properly reset the response code for each request. */
    die('skip Not repeatable');
}
?>
--FILE--
<?php
var_dump(
    // Get the current default response code
    http_response_code(),
    // Set a response code
    http_response_code(201),
    // Get the new response code
    http_response_code()
);
?>
--EXPECT--
bool(false)
bool(true)
int(201)

Function Calls

getenv 1

Variables

None

Stats

MD5 d2a663166aced892626c88db1953dbc1
Eval Count 0
Decode Time 113 ms