3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class AbstractFoo { protected $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 7.1.0
int(350080) int(350432) int(350432) int(350432) int(350432) int(350432)
Output for 7.0.0 - 7.0.14
int(350104) int(350456) int(350456) int(350456) int(350456) int(350456)
Output for hhvm-3.10.0 - 3.12.0
int(2097152) int(2097152) int(2097152) int(2097152) int(2097152) int(2097152)
Output for 5.6.7 - 5.6.28
int(223840) int(224088) int(224176) int(224264) int(224352) int(224440)
Output for 5.5.24 - 5.5.35
int(223832) int(224064) int(224152) int(224240) int(224328) int(224416)
Output for 5.4.10 - 5.4.45
int(224344) int(224576) int(224664) int(224752) int(224848) int(224936)
Output for 5.4.0 - 5.4.9
int(224344) int(224576) int(224664) int(224752) int(224840) int(224928)
Output for 5.3.11 - 5.3.29
int(627648) int(627768) int(627856) int(627944) int(628032) int(628120)
Output for 5.3.0 - 5.3.10
int(627344) int(627464) int(627552) int(627640) int(627728) int(627816)
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/fR2EH on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/fR2EH on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/fR2EH on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/fR2EH on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/fR2EH on line 6
Process exited with code 255.