3v4l.org

run code in 300+ PHP versions simultaneously
<?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']);
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.6
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/YaiGI on line 5 Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/YaiGI on line 7 Warning: assert(): Assertion "empty($arguments) || strtr($string, $arguments) != implode($arguments)" failed in /in/YaiGI on line 7
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.3.32 - 7.3.33
Warning: assert(): Assertion "empty($arguments) || strtr($string, $arguments) != implode($arguments)" failed in /in/YaiGI on line 7

preferences:
242.12 ms | 403 KiB | 376 Q