3v4l.org

run code in 500+ PHP versions simultaneously
<?php if (class_exists('A')) { echo "1 A exists, early returning.\n"; return; } else { echo "1 A does not exist, continuing.\n"; } echo "1 Continuing evaluation…\n"; class A {} function f() {} if (class_exists('A')) { echo "2 A exists, early returning.\n"; return; } else { echo "2 A does not exist, continuing.\n"; } echo "2 Continuing evaluation…\n"; // Apparently this is fine even though we're defining the same class? class A {} // Uncomment this and it's an error: // function f() {}
Output for rfc.property-hooks, git.master, git.master_jit
1 A exists, early returning.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
91.79 ms | 2705 KiB | 4 Q