3v4l.org

run code in 300+ PHP versions simultaneously
<?php function d(): double {} function f(): float {} function i(): int {} function ie(): integer {} function r(): real {} function bn(): boolean {} foreach (['d', 'f'] as $name) { $ref = new ReflectionFunction($name); var_dump([$name, $ref->getReturnType()->getName(), $ref->getReturnType()->isBuiltin()]); }
Output for git.master_jit, git.master
Warning: "double" will be interpreted as a class name. Did you mean "float"? Write "\double" to suppress this warning in /in/T9iRf on line 3 Warning: "integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning in /in/T9iRf on line 6 Warning: "boolean" will be interpreted as a class name. Did you mean "bool"? Write "\boolean" to suppress this warning in /in/T9iRf on line 8 array(3) { [0]=> string(1) "d" [1]=> string(6) "double" [2]=> bool(false) } array(3) { [0]=> string(1) "f" [1]=> string(5) "float" [2]=> bool(true) }

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:
58.94 ms | 406 KiB | 5 Q