3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Math { const $pi = 3.14; } class CircleMath extends Math { public static function calculateArea($radio) { return self::$pi * pow($radio, 2); } } $radio = 5; echo sprintf('El área del circulo con radio de longitud %s es: %s', $radio, CircleMath::calculateArea($radio)); ?>
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '$pi' (T_VARIABLE), expecting identifier (T_STRING) in /in/rIEfG on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/rIEfG on line 3
Process exited with code 255.

preferences:
191.4 ms | 1395 KiB | 57 Q