3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 10; $b = 20; $c = 30; $d = 40; $defined_variables = get_defined_vars(); $variables2keep = array("a", "b", "c"); foreach($defined_variables as $variable => $value) if(!in_array($variable, $variables2keep)) unset($$variable); print_r(get_defined_vars());
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [a] => 10 [b] => 20 [c] => 30 [defined_variables] => Array ( [_GET] => Array ( ) [_POST] => Array ( ) [_COOKIE] => Array ( ) [_FILES] => Array ( ) [argv] => Array ( [0] => /in/3tQ45 ) [argc] => 1 [_SERVER] => Array ( [TERM] => xterm [PATH] => /usr/bin:/bin [LANG] => C [SHELL] => /bin/sh [MAIL] => /var/mail/nobody [LOGNAME] => nobody [USER] => nobody [HOME] => /tmp [PHP_SELF] => /in/3tQ45 [SCRIPT_NAME] => /in/3tQ45 [SCRIPT_FILENAME] => /in/3tQ45 [PATH_TRANSLATED] => /in/3tQ45 [DOCUMENT_ROOT] => [REQUEST_TIME_FLOAT] => 1414515000.0001 [REQUEST_TIME] => 1414515000 [argv] => Array ( [0] => /in/3tQ45 ) [argc] => 1 ) [a] => 10 [b] => 20 [c] => 30 [d] => 40 ) [variables2keep] => Array ( [0] => a [1] => b [2] => c ) [value] => 40 [variable] => d )

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:
70.32 ms | 405 KiB | 8 Q