3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $bad = "♥"; $key = array_keys( $rc->getConstants() ); $target = $key[ 0 ]; //php5.6: if ( mb_substr( $target, -1,1) == $bad ) { $pos = strpos( $target, $bad ); var_dump( $pos,mb_substr( $target, $pos,1 )); if ($pos !== FALSE) { trigger_error( "'$bad_char' in '$target'" ); }
Output for git.master, git.master_jit, rfc.property-hooks
int(2) string(3) "♥" Warning: Undefined variable $bad_char in /in/Bu5ot on line 11 Notice: '' in 'AB♥' in /in/Bu5ot on line 11

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:
37.17 ms | 401 KiB | 8 Q