3v4l.org

run code in 300+ 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 git.master_jit, git.master, rfc.property-hooks
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:
124.85 ms | 405 KiB | 5 Q