3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace test\load { class testIn { public function testIt() { } } } namespace testCall\toHell { // use test\load\testIn; class wtf { public function __construct(testIn $variable) { echo 'OK!'; } } } namespace { $r = new ReflectionClass('\testCall\toHell\wtf'); $constructorArguments[] = new test\load\testIn(); $instance = $r->newInstanceArgs($constructorArguments); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: testCall\toHell\wtf::__construct(): Argument #1 ($variable) must be of type testCall\toHell\testIn, test\load\testIn given in /in/Gvotn:24 Stack trace: #0 [internal function]: testCall\toHell\wtf->__construct(Object(test\load\testIn)) #1 /in/Gvotn(38): ReflectionClass->newInstanceArgs(Array) #2 {main} thrown in /in/Gvotn on line 24
Process exited with code 255.

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