3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; function assert() { var_dump(__METHOD__); } var_dump(ini_get("zend.assertions")); assert(); // namespaced function is called ini_set("zend.assertions", 0); var_dump(ini_get("zend.assertions")); assert(); // namespaced function isn't called
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Defining a custom assert() function is not allowed, as the function has special semantics in /in/8EKdA on line 5
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Deprecated: Defining a custom assert() function is deprecated, as the function has special semantics in /in/8EKdA on line 5 string(1) "1" string(10) "Foo\assert" string(1) "0"
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.32 - 7.3.33
string(1) "1" string(10) "Foo\assert" string(1) "0"

preferences:
144.8 ms | 409 KiB | 5 Q