3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Vite { protected $buildDirectory; public function useBuildDirectory($path) { $this->buildDirectory = $path; } public function __invoke($entry, $buildDirectory = 'default') { return func_get_args()[1] ?? $this->buildDirectory ?? 'default'; } } $vite = new Vite(); var_dump([ 'expect' => 'default', 'recieved' => $vite([]) ]); var_dump([ 'expect' => 'foo', 'recieved' => $vite([], 'foo') ]); $vite->useBuildDirectory('custom'); var_dump([ 'expect' => 'custom', 'recieved' => $vite([]) ]); var_dump([ 'expect' => 'foo', 'recieved' => $vite([], 'foo') ]);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["expect"]=> string(7) "default" ["recieved"]=> string(7) "default" } array(2) { ["expect"]=> string(3) "foo" ["recieved"]=> string(3) "foo" } array(2) { ["expect"]=> string(6) "custom" ["recieved"]=> string(6) "custom" } array(2) { ["expect"]=> string(3) "foo" ["recieved"]=> string(3) "foo" }

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