3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait theTrait { public function test($a, $x=[]) { if (isset($this->x)) { echo 'prefixed: ' . $a; } else { echo $a; } } } class theClass { use theTrait; protected $x = []; } /* class theExtend extends theClass { public function test($b) { echo 'prefixed: ' . $b; } } */ $x = new theClass; $x->test('test');

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
165 ms | 3315 KiB | 8 Q