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 DateTime class inheritance : with user space format() method --FILE-- <?php ..
Decoded Output download
--TEST--
Test DateTime class inheritance : with user space format() method
--FILE--
<?php
//Set the default time zone
date_default_timezone_set("Europe/London");
echo "*** Testing new DateTime() : with user format() method ***
";
class DateTimeExt extends DateTime
{
public function format($format = "F j, Y, g:i:s a"): string
{
return parent::format($format);
}
}
$d = new DateTimeExt("1967-05-01 22:30:41");
echo $d->format() . "
";
?>
--EXPECT--
*** Testing new DateTime() : with user format() method ***
May 1, 1967, 10:30:41 pm
Did this file decode correctly?
Original Code
--TEST--
Test DateTime class inheritance : with user space format() method
--FILE--
<?php
//Set the default time zone
date_default_timezone_set("Europe/London");
echo "*** Testing new DateTime() : with user format() method ***\n";
class DateTimeExt extends DateTime
{
public function format($format = "F j, Y, g:i:s a"): string
{
return parent::format($format);
}
}
$d = new DateTimeExt("1967-05-01 22:30:41");
echo $d->format() . "\n";
?>
--EXPECT--
*** Testing new DateTime() : with user format() method ***
May 1, 1967, 10:30:41 pm
Function Calls
None |
Stats
MD5 | 50b63ba628029305fe7b08842f1a2f73 |
Eval Count | 0 |
Decode Time | 93 ms |