3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function assert_in_function() { assert_options(ASSERT_ACTIVE, true); $value = '2'; var_dump(assert(is_string($value))); var_dump(assert('is_string($value)')); } assert_options(ASSERT_ACTIVE, true); $value = '1'; var_dump(assert(is_string($value))); var_dump(assert('is_string($value)')); var_dump(assert('is_array($value)')); assert_in_function();
Output for 7.2.0
bool(true) Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/ImVcW on line 13 bool(true) Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/ImVcW on line 14 Warning: assert(): Assertion "is_array($value)" failed in /in/ImVcW on line 14 bool(false) bool(true) Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/ImVcW on line 8 bool(true)
Output for 7.0.1 - 7.1.10
bool(true) bool(true) Warning: assert(): Assertion "is_array($value)" failed in /in/ImVcW on line 14 bool(false) bool(true) bool(true)
Output for 5.3.19 - 7.0.0
bool(true) bool(true) Warning: assert(): Assertion "is_array($value)" failed in /in/ImVcW on line 14 NULL bool(true) bool(true)