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 __set_state magic method for recreating a DateTimeZone object --CREDITS-- Ma..

Decoded Output download

--TEST--
Test __set_state magic method for recreating a DateTimeZone object
--CREDITS--
Mark Baker [email protected] at the PHPNW2017 Conference for PHP Testfest 2017
--FILE--
<?php

$datetimezoneObject = new DateTimezone('UTC');

$datetimezoneState = var_export($datetimezoneObject, true);

eval("\$datetimezoneObjectNew = {$datetimezoneState};");

var_dump($datetimezoneObjectNew);

?>
--EXPECTF--
object(DateTimeZone)#%d (2) {
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(3) "UTC"
}

Did this file decode correctly?

Original Code

--TEST--
Test __set_state magic method for recreating a DateTimeZone object
--CREDITS--
Mark Baker [email protected] at the PHPNW2017 Conference for PHP Testfest 2017
--FILE--
<?php

$datetimezoneObject = new DateTimezone('UTC');

$datetimezoneState = var_export($datetimezoneObject, true);

eval("\$datetimezoneObjectNew = {$datetimezoneState};");

var_dump($datetimezoneObjectNew);

?>
--EXPECTF--
object(DateTimeZone)#%d (2) {
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(3) "UTC"
}

Function Calls

None

Variables

None

Stats

MD5 1da2d741c2c8ba1719086ecba9a79482
Eval Count 0
Decode Time 89 ms