3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL ~ E_STRICT); class A { public function create() { return new static(); } } class B { public function meh() { return A::create(); } } $b = new B; echo get_class($b->meh()); // B ?
Output for 5.3.23, 5.4.13
Parse error: syntax error, unexpected '~' in /in/1Bptc on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.4.0 - 5.4.12
Parse error: syntax error, unexpected '~' in CDFv1 on line 3
Process exited with code 255.

preferences:
179.4 ms | 1395 KiB | 45 Q