3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Shape { public function area() { return 0; } public function sides () { return 0; } } class Rectangle extends Shape { public function area($width,$length) { $area = $width*$length; echo $area . ", "; } public function sides() { } } class Circle extends Shape { public function area($radius,$pi) { $area = pow($radius, 2)*$pi; echo $area . ", "; } public function sides() { } } class Square extends Shape { public function area($side) { $area = pow($side, 2); echo $area; } } $s = new Rectangle(); $s->area(3,15); $c = new Circle(); $c->area(3,3.14); $q = new Square(); $q->area(3);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Declaration of Rectangle::area($width, $length) must be compatible with Shape::area() in /in/KWBnY on line 17
Process exited with code 255.

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