3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class Class1 { var $testVar = 5; function foo(){ echo $this->foo2(); } function foo2(){ } } class Class2 { function __construct(){ $this->class1 = new Class1(); } function bar(){ //This doesn't report an error because error level 'strict' is disabled. Class1::foo(); } } $class2 = new Class2(); $class2->bar(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Class2::$class1 is deprecated in /in/P7jSP on line 21 Fatal error: Uncaught Error: Non-static method Class1::foo() cannot be called statically in /in/P7jSP:26 Stack trace: #0 /in/P7jSP(33): Class2->bar() #1 {main} thrown in /in/P7jSP on line 26
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:
68.11 ms | 401 KiB | 8 Q