3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __toString() { return 'stringable'; } } $inputs = [null, false, true, 0, 1, new Foo()]; foreach ($inputs as $input) { $sfi = new SplFileInfo($input); print("-----\n"); var_export($input); print("\n"); var_export($sfi->getPathname()); print("\n"); var_export($sfi->getPath()); print("\n"); }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: SplFileInfo::__construct(): Passing null to parameter #1 ($filename) of type string is deprecated in /in/JcZaf on line 12 ----- NULL '' '' ----- false '' '' ----- true '1' '' ----- 0 '0' '' ----- 1 '1' '' ----- \Foo::__set_state(array( )) 'stringable' ''

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:
97.91 ms | 1529 KiB | 4 Q