3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* final */class Animal { public static $version = 'ANI01'; public function move(int $steps): void { echo "$steps déplacements"; } public static function version(): string { // return static::$version; return self::$version; } } class Cat extends Animal { public static $version = 'CAT07'; public function move(int $steps): void { // parent::move($steps); echo "$steps pas"; } } $animal = new Animal(); $cat = new Cat(); $cat->move(2); echo PHP_EOL; echo Cat::version().PHP_EOL; var_dump($cat instanceof Animal); var_dump(Cat::class);
Output for git.master, git.master_jit, rfc.property-hooks
2 pas ANI01 bool(true) string(3) "Cat"

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:
27.88 ms | 401 KiB | 8 Q