3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { protected $foo = 'foo'; public string $bar { get { $return = $this->foo; if (Fiber::getCurrent()) { Fiber::suspend(); } print ($return); return $return; } } } $foo = new Foo(); $fiber = new Fiber(function () use ($foo) { $foo->bar; }); $value = $fiber->start(); $foo->bar; $fiber->resume('test');
Output for 8.5.1
foofoo
Output for 8.3.5
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/tpXCf on line 5
Process exited with code 255.

preferences:
50.45 ms | 492 KiB | 3 Q