3v4l.org

run code in 200+ PHP versions simultaneously
<?php define('FOO', bin2hex(random_bytes(32))); class Bar { const BAZ = FOO; } class Qux extends Bar { const BAZ = 'lol'; } var_dump(Qux::BAZ);
based on KJkmQ

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
string(3) "lol"
Output for branch php-master+opcache
string(3) "lol"
Output for branch php-master+jit
string(3) "lol"
Output for Typed properties v2
string(3) "lol"
Output for Arrow functions
/bin/php-rfc-arrow_functions: error while loading shared libraries: libicui18n.so.58: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for Object typehint
/bin/php-rfc-object-typehint: error while loading shared libraries: libmcrypt.so.4: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for Array change keys
/bin/php-rfc-array_change_keys: error while loading shared libraries: libmcrypt.so.4: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for Lexical anon
/bin/php-rfc-lexical-anon: error while loading shared libraries: libmcrypt.so.4: cannot open shared object file: No such file or directory
Process exited with code 127.

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