3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Math { const pi = 3.14; } class CircleMath extends Math { public static function calculateArea($radio) { return parent::pi * pow($radio, 2); } } class Circle { private $radio = '0.0'; private $color = <<<EOT red EOT; public function __construct($radio, $color) { $this->radio = $radio; $this->color = $color; } public function calculateArea() { return CircleMath::calculateArea($this->radio); } public function get_radio() { return $this->radio; } public function get_color() { return $this->color; } } $className = 'Circle'; $circle = new $className(6, 'blue'); echo sprintf('El área del circulo color %s y con radio de longitud %s es: %s', $circle->get_color(), $circle->get_radio(), $circle->calculateArea()); ?>
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '<<' (T_SL) in /in/Sb9ev on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_SL in /in/Sb9ev on line 15
Process exited with code 255.