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 dgettext() functionality --EXTENSIONS-- gettext --SKIPIF-- <?php if (!setlo..

Decoded Output download

--TEST--
Test dgettext() functionality
--EXTENSIONS--
gettext
--SKIPIF--
<?php

if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
    die("SKIP en_US.UTF-8 locale not supported.");
}
--FILE--
<?php
chdir(__DIR__);
putenv('LC_MESSAGES=en_US.UTF-8');
setlocale(LC_MESSAGES, 'en_US.UTF-8');
putenv('LC_ALL=en_US.UTF-8');
setlocale(LC_ALL, 'en_US.UTF-8');
bindtextdomain('dgettextTest', './locale');
bindtextdomain('dgettextTest_switch', './locale');
textdomain('dgettextTest');

var_dump(gettext('item'));
var_dump(dgettext('dgettextTest_switch', 'item'));
var_dump(gettext('item'));
?>
--EXPECT--
string(7) "Produkt"
string(16) "Produkt_switched"
string(7) "Produkt"
--CREDITS--
Moritz Neuhaeuser, [email protected]
PHP Testfest Berlin 2009-05-09

Did this file decode correctly?

Original Code

--TEST--
Test dgettext() functionality
--EXTENSIONS--
gettext
--SKIPIF--
<?php

if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
    die("SKIP en_US.UTF-8 locale not supported.");
}
--FILE--
<?php
chdir(__DIR__);
putenv('LC_MESSAGES=en_US.UTF-8');
setlocale(LC_MESSAGES, 'en_US.UTF-8');
putenv('LC_ALL=en_US.UTF-8');
setlocale(LC_ALL, 'en_US.UTF-8');
bindtextdomain('dgettextTest', './locale');
bindtextdomain('dgettextTest_switch', './locale');
textdomain('dgettextTest');

var_dump(gettext('item'));
var_dump(dgettext('dgettextTest_switch', 'item'));
var_dump(gettext('item'));
?>
--EXPECT--
string(7) "Produkt"
string(16) "Produkt_switched"
string(7) "Produkt"
--CREDITS--
Moritz Neuhaeuser, [email protected]
PHP Testfest Berlin 2009-05-09

Function Calls

None

Variables

None

Stats

MD5 c5d0021afe69ce577f41804e60740ce6
Eval Count 0
Decode Time 86 ms