3v4l.org

run code in 300+ PHP versions simultaneously
<?php function var_types() { $bt = debug_backtrace()[0]; $file = new \SPLFileObject($bt['file']); $file->seek($bt['line'] - 1); $line = $file->current(); $matchs = null; preg_match('/var_types\((.*)\)/', $line, $matchs); $param_names = array_map('trim', explode(",", $matchs[1])); $args = func_get_args(); for ($i = 0; $i < count($args); $i++) { echo $param_names[$i] . ' ' . gettype($args[$i]) . PHP_EOL; } } define('MY_CONSTANT', 1); $string = "STR"; $num = 123.4; var_types(MY_CONSTANT, $string, $num, $_GET, $_SERVER['PHP_SELF']);
Output for git.master, git.master_jit, rfc.property-hooks
MY_CONSTANT integer $string string $num double $_GET array $_SERVER['PHP_SELF'] string

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