3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function a () { $this = rand(); var_dump('reassigned', $this); } } $a = new A(); var_dump('new', $a); //$a->a(); var_dump('modified', $a); var_Dump(new A(), new A(), new A(), new A());
based on GrWX1
Output for 5.0.0 - 5.4.35
Fatal error: Cannot re-assign $this in /in/5WSoa on line 7
Process exited with code 255.
Output for 4.4.9
string(10) "reassigned" int(1735418661) string(3) "new" int(1735418661) string(8) "modified" int(1735418661) string(10) "reassigned" int(719675717) string(10) "reassigned" int(245495371) string(10) "reassigned" int(334579029) string(10) "reassigned" int(2128264417) int(719675717) int(245495371) int(334579029) int(2128264417)
Output for 4.4.8
string(10) "reassigned" int(1518132371) string(3) "new" int(1518132371) string(8) "modified" int(1518132371) string(10) "reassigned" int(497661882) string(10) "reassigned" int(1189586431) string(10) "reassigned" int(160745015) string(10) "reassigned" int(667591534) int(497661882) int(1189586431) int(160745015) int(667591534)
Output for 4.4.7
string(10) "reassigned" int(2085324812) string(3) "new" int(2085324812) string(8) "modified" int(2085324812) string(10) "reassigned" int(241640767) string(10) "reassigned" int(1282938933) string(10) "reassigned" int(1030908971) string(10) "reassigned" int(1377944721) int(241640767) int(1282938933) int(1030908971) int(1377944721)
Output for 4.4.6
string(10) "reassigned" int(560808689) string(3) "new" int(560808689) string(8) "modified" int(560808689) string(10) "reassigned" int(1352026832) string(10) "reassigned" int(1780701737) string(10) "reassigned" int(209149806) string(10) "reassigned" int(315358629) int(1352026832) int(1780701737) int(209149806) int(315358629)
Output for 4.4.5
string(10) "reassigned" int(11305517) string(3) "new" int(11305517) string(8) "modified" int(11305517) string(10) "reassigned" int(115785537) string(10) "reassigned" int(1384605331) string(10) "reassigned" int(335585806) string(10) "reassigned" int(1902986778) int(115785537) int(1384605331) int(335585806) int(1902986778)
Output for 4.4.4
string(10) "reassigned" int(623021300) string(3) "new" int(623021300) string(8) "modified" int(623021300) string(10) "reassigned" int(1902671840) string(10) "reassigned" int(226935696) string(10) "reassigned" int(629901056) string(10) "reassigned" int(1190207327) int(1902671840) int(226935696) int(629901056) int(1190207327)
Output for 4.4.3
string(10) "reassigned" int(1064443020) string(3) "new" int(1064443020) string(8) "modified" int(1064443020) string(10) "reassigned" int(1667714768) string(10) "reassigned" int(1381415705) string(10) "reassigned" int(2066498966) string(10) "reassigned" int(2054305280) int(1667714768) int(1381415705) int(2066498966) int(2054305280)
Output for 4.4.2
string(10) "reassigned" int(780585343) string(3) "new" int(780585343) string(8) "modified" int(780585343) string(10) "reassigned" int(8677890) string(10) "reassigned" int(173903834) string(10) "reassigned" int(119006990) string(10) "reassigned" int(1503975115) int(8677890) int(173903834) int(119006990) int(1503975115)
Output for 4.4.1
string(10) "reassigned" int(501276505) string(3) "new" int(501276505) string(8) "modified" int(501276505) string(10) "reassigned" int(230045401) string(10) "reassigned" int(989015224) string(10) "reassigned" int(1911996661) string(10) "reassigned" int(1462274481) int(230045401) int(989015224) int(1911996661) int(1462274481)
Output for 4.4.0
string(10) "reassigned" int(12130763) string(3) "new" int(12130763) string(8) "modified" int(12130763) string(10) "reassigned" int(544533214) string(10) "reassigned" int(1151720905) string(10) "reassigned" int(1777062397) string(10) "reassigned" int(636800080) int(544533214) int(1151720905) int(1777062397) int(636800080)
Output for 4.3.11
string(10) "reassigned" int(1089949590) string(3) "new" int(1089949590) string(8) "modified" int(1089949590) string(10) "reassigned" int(156210327) string(10) "reassigned" int(864823247) string(10) "reassigned" int(2078641055) string(10) "reassigned" int(1132368622) int(156210327) int(864823247) int(2078641055) int(1132368622)
Output for 4.3.10
string(10) "reassigned" int(438778507) string(3) "new" int(438778507) string(8) "modified" int(438778507) string(10) "reassigned" int(918963710) string(10) "reassigned" int(1154532858) string(10) "reassigned" int(310950890) string(10) "reassigned" int(1481919087) int(918963710) int(1154532858) int(310950890) int(1481919087)
Output for 4.3.9
string(10) "reassigned" int(1741581320) string(3) "new" int(1741581320) string(8) "modified" int(1741581320) string(10) "reassigned" int(784534203) string(10) "reassigned" int(1367128952) string(10) "reassigned" int(448415393) string(10) "reassigned" int(1015593732) int(784534203) int(1367128952) int(448415393) int(1015593732)
Output for 4.3.8
string(10) "reassigned" int(1368367229) string(3) "new" int(1368367229) string(8) "modified" int(1368367229) string(10) "reassigned" int(1361007250) string(10) "reassigned" int(897114956) string(10) "reassigned" int(2108946086) string(10) "reassigned" int(54813415) int(1361007250) int(897114956) int(2108946086) int(54813415)
Output for 4.3.7
string(10) "reassigned" int(1208287598) string(3) "new" int(1208287598) string(8) "modified" int(1208287598) string(10) "reassigned" int(1890212204) string(10) "reassigned" int(2133337308) string(10) "reassigned" int(1969732173) string(10) "reassigned" int(1222734072) int(1890212204) int(2133337308) int(1969732173) int(1222734072)
Output for 4.3.6
string(10) "reassigned" int(672904974) string(3) "new" int(672904974) string(8) "modified" int(672904974) string(10) "reassigned" int(1032684347) string(10) "reassigned" int(304899383) string(10) "reassigned" int(1280009792) string(10) "reassigned" int(1047404494) int(1032684347) int(304899383) int(1280009792) int(1047404494)
Output for 4.3.5
string(10) "reassigned" int(1160747190) string(3) "new" int(1160747190) string(8) "modified" int(1160747190) string(10) "reassigned" int(1846783110) string(10) "reassigned" int(1998601112) string(10) "reassigned" int(1396853328) string(10) "reassigned" int(1534241510) int(1846783110) int(1998601112) int(1396853328) int(1534241510)
Output for 4.3.4
string(10) "reassigned" int(1038770179) string(3) "new" int(1038770179) string(8) "modified" int(1038770179) string(10) "reassigned" int(1717216881) string(10) "reassigned" int(420417776) string(10) "reassigned" int(210146364) string(10) "reassigned" int(339087644) int(1717216881) int(420417776) int(210146364) int(339087644)
Output for 4.3.3
string(10) "reassigned" int(1579020840) string(3) "new" int(1579020840) string(8) "modified" int(1579020840) string(10) "reassigned" int(1027412744) string(10) "reassigned" int(1588755522) string(10) "reassigned" int(187202376) string(10) "reassigned" int(1880568193) int(1027412744) int(1588755522) int(187202376) int(1880568193)
Output for 4.3.2
string(10) "reassigned" int(222547498) string(3) "new" int(222547498) string(8) "modified" int(222547498) string(10) "reassigned" int(1592691875) string(10) "reassigned" int(2098151189) string(10) "reassigned" int(1525271063) string(10) "reassigned" int(2145292059) int(1592691875) int(2098151189) int(1525271063) int(2145292059)
Output for 4.3.1
string(10) "reassigned" int(1550749638) string(3) "new" int(1550749638) string(8) "modified" int(1550749638) string(10) "reassigned" int(2048863906) string(10) "reassigned" int(1116176853) string(10) "reassigned" int(1532224863) string(10) "reassigned" int(1767072829) int(2048863906) int(1116176853) int(1532224863) int(1767072829)
Output for 4.3.0
string(10) "reassigned" int(857516403) string(3) "new" int(857516403) string(8) "modified" int(857516403) string(10) "reassigned" int(837969944) string(10) "reassigned" int(1115122182) string(10) "reassigned" int(1264512925) string(10) "reassigned" int(413463036) int(837969944) int(1115122182) int(1264512925) int(413463036)