3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class AbstractFoo { $data = array('dsdsdssdssdsd','sdvuiouthskrjeklajklsdajfklsdjfsdkfhjksdhfdjkfhksdhf','vhweuihfeaajklfldajfafhkashdjdahjkadfhsdjkfhdjkfhjksf', 'Äfhdsuihcdhckdufhdjkfhjkdhfjkdfhjkdfhjkdshfjfdsfsdfdsfdsfds'); protected static $state = array(); public function publish() { static::$state[] = $this; } } $foo = new AbstractFoo; var_dump(memory_get_usage()); $foo->publish(); var_dump(memory_get_usage()); $foo->publish(); var_dump(memory_get_usage()); $foo->publish(); var_dump(memory_get_usage()); $foo->publish(); var_dump(memory_get_usage()); $foo->publish(); var_dump(memory_get_usage());
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '$data' (T_VARIABLE), expecting function (T_FUNCTION) in /in/Tdbq0 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/Tdbq0 on line 6
Process exited with code 255.