3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait A { function calc1($v) { echo 'ttttttttttttt'; return $v+1; } } class MyClass { use A; function calc($v) { echo '123'; $this->calc1(); //parent::calc($v); } } $x=new MyClass(); $x->calc(123);
based on cT3RQ
Output for 7.1.0 - 7.2.0
123 Fatal error: Uncaught ArgumentCountError: Too few arguments to function MyClass::calc1(), 0 passed in /in/TVqe4 on line 14 and exactly 1 expected in /in/TVqe4:3 Stack trace: #0 /in/TVqe4(14): MyClass->calc1() #1 /in/TVqe4(20): MyClass->calc(123) #2 {main} thrown in /in/TVqe4 on line 3
Process exited with code 255.
Output for 5.4.9 - 7.0.20
123 Warning: Missing argument 1 for MyClass::calc1(), called in /in/TVqe4 on line 14 and defined in /in/TVqe4 on line 3 ttttttttttttt Notice: Undefined variable: v in /in/TVqe4 on line 5
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/TVqe4 on line 2
Process exited with code 255.