@ 2015-09-17T12:02:40Z <?php
function test_assert($string, $arguments = array()) {
// Make sure we don't pass in an empty string.
assert('$string !== \'\' && (empty($arguments) || strtr($string, $arguments) !== \'\'))');
// Make sure we don't translate unnecessarily.
assert('empty($arguments) || strtr($string, $arguments) != implode($arguments)');
}
test_assert('@test', ['@test' => 'test']);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Output for 7.2.0 - 7.2.33 , 7.3.16 - 7.3.31 , 7.4.0 - 7.4.33 Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/buOGu on line 5
Fatal error: Uncaught ParseError: syntax error, unexpected ')', expecting ';' in /in/buOGu(5) : assert code:1
Stack trace:
#0 /in/buOGu(5): assert('$string !== '' ...')
#1 /in/buOGu(10): test_assert('@test', Array)
#2 {main}
Next Error: Failure evaluating code:
$string !== '' && (empty($arguments) || strtr($string, $arguments) !== '')) in /in/buOGu:5
Stack trace:
#0 /in/buOGu(5): assert('$string !== '' ...')
#1 /in/buOGu(10): test_assert('@test', Array)
#2 {main}
thrown in /in/buOGu on line 5
Process exited with code 255 . Output for 7.1.0 - 7.1.20 , 7.3.32 - 7.3.33 Fatal error: Uncaught ParseError: syntax error, unexpected ')', expecting ';' in /in/buOGu(5) : assert code:1
Stack trace:
#0 /in/buOGu(5): assert('$string !== '' ...')
#1 /in/buOGu(10): test_assert('@test', Array)
#2 {main}
Next Error: Failure evaluating code:
$string !== '' && (empty($arguments) || strtr($string, $arguments) !== '')) in /in/buOGu:5
Stack trace:
#0 /in/buOGu(5): assert('$string !== '' ...')
#1 /in/buOGu(10): test_assert('@test', Array)
#2 {main}
thrown in /in/buOGu on line 5
Process exited with code 255 . Output for 7.0.0 - 7.0.20 Parse error: syntax error, unexpected ')', expecting ';' in /in/buOGu(5) : assert code on line 1
Catchable fatal error: assert(): Failure evaluating code:
$string !== '' && (empty($arguments) || strtr($string, $arguments) !== '')) in /in/buOGu on line 5
Process exited with code 255 . Output for 5.4.0 - 5.4.45 , 5.5.24 - 5.5.35 , 5.6.7 - 5.6.28 Parse error: syntax error, unexpected ')' in /in/buOGu(5) : assert code on line 1
Catchable fatal error: assert(): Failure evaluating code:
$string !== '' && (empty($arguments) || strtr($string, $arguments) !== '')) in /in/buOGu on line 5
Process exited with code 255 . preferences:dark mode live preview
197.65 ms | 402 KiB | 229 Q