3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class B { } class A { public function M() { echo("this=" . get_class($this) . " hash=" . spl_object_hash($this) . "\n"); $x = "this"; $$x = new B(); echo("this=" . get_class($this) . " hash=" . spl_object_hash($this) . "\n"); } } $a = new A(); $a->M();
Output for 7.2.0
this=A hash=0000000055357a94000000000ac88b1c Fatal error: Uncaught Error: Cannot re-assign $this in /in/DDgo9:12 Stack trace: #0 /in/DDgo9(18): A->M() #1 {main} thrown in /in/DDgo9 on line 12
Process exited with code 255.
Output for 7.1.10
this=A hash=000000003d40825f00000000180e0f41 Fatal error: Uncaught Error: Cannot re-assign $this in /in/DDgo9:12 Stack trace: #0 /in/DDgo9(18): A->M() #1 {main} thrown in /in/DDgo9 on line 12
Process exited with code 255.
Output for 7.1.7
this=A hash=0000000056c3ec0e0000000053526a9d Fatal error: Uncaught Error: Cannot re-assign $this in /in/DDgo9:12 Stack trace: #0 /in/DDgo9(18): A->M() #1 {main} thrown in /in/DDgo9 on line 12
Process exited with code 255.
Output for 7.1.6
this=A hash=000000001f31f21f000000007506da94 Fatal error: Uncaught Error: Cannot re-assign $this in /in/DDgo9:12 Stack trace: #0 /in/DDgo9(18): A->M() #1 {main} thrown in /in/DDgo9 on line 12
Process exited with code 255.
Output for 7.1.5
this=A hash=000000002bb636560000000012ad20e0 Fatal error: Uncaught Error: Cannot re-assign $this in /in/DDgo9:12 Stack trace: #0 /in/DDgo9(18): A->M() #1 {main} thrown in /in/DDgo9 on line 12
Process exited with code 255.
Output for 7.1.0
this=A hash=000000005ac3c721000000006929d2b6 Fatal error: Uncaught Error: Cannot re-assign $this in /in/DDgo9:12 Stack trace: #0 /in/DDgo9(18): A->M() #1 {main} thrown in /in/DDgo9 on line 12
Process exited with code 255.
Output for 7.0.20
this=A hash=000000001036dadc00000000364eae50 this=B hash=000000001036dadf00000000364eae50
Output for 7.0.6
this=A hash=000000001a083166000000003abcd0a8 this=B hash=000000001a083165000000003abcd0a8
Output for 7.0.5
this=A hash=000000006083777e000000005d1fbda1 this=B hash=000000006083777d000000005d1fbda1
Output for 7.0.4
this=A hash=00000000205ef149000000002e7e4843 this=B hash=00000000205ef14a000000002e7e4843
Output for 7.0.3
this=A hash=00000000371adbdf00000000373ee00c this=B hash=00000000371adbdc00000000373ee00c
Output for 7.0.2
this=A hash=000000007a2b4b5a000000000f8c228d this=B hash=000000007a2b4b59000000000f8c228d
Output for 7.0.1
this=A hash=000000007265cda00000000021186723 this=B hash=000000007265cda30000000021186723
Output for 7.0.0
this=A hash=0000000023bfba76000000007eb33ffc this=B hash=0000000023bfba75000000007eb33ffc
Output for 5.6.28
this=A hash=000000006bce45f7000000000b4ab5e9 this=B hash=000000006bce45f4000000000b4ab5e9
Output for 5.6.21
this=A hash=000000000c0370e6000000002f89ab77 this=B hash=000000000c0370e5000000002f89ab77
Output for 5.6.20
this=A hash=000000007508d3450000000026b9e018 this=B hash=000000007508d3460000000026b9e018
Output for 5.6.19
this=A hash=0000000065da176f0000000030adc479 this=B hash=0000000065da176c0000000030adc479
Output for 5.6.18
this=A hash=00000000703b88eb00000000458b1d1b this=B hash=00000000703b88e800000000458b1d1b
Output for 5.6.17
this=A hash=000000002e9ad9ab000000003213d449 this=B hash=000000002e9ad9a8000000003213d449
Output for 5.6.16
this=A hash=0000000032a069930000000070d23ae4 this=B hash=0000000032a069900000000070d23ae4
Output for 5.6.15
this=A hash=00000000755310bd000000003060c393 this=B hash=00000000755310be000000003060c393
Output for 5.6.14
this=A hash=000000005eb4d1aa00000000446a7548 this=B hash=000000005eb4d1a900000000446a7548
Output for 5.6.13
this=A hash=0000000053ecf5ba000000006f57ffd8 this=B hash=0000000053ecf5b9000000006f57ffd8
Output for 5.6.12
this=A hash=00000000494f68e7000000007d787132 this=B hash=00000000494f68e4000000007d787132
Output for 5.6.11
this=A hash=000000002f249f810000000002a13a5c this=B hash=000000002f249f820000000002a13a5c
Output for 5.6.10
this=A hash=00000000200c17eb00000000428163b5 this=B hash=00000000200c17e800000000428163b5
Output for 5.6.9
this=A hash=000000005caeecf2000000001dbde610 this=B hash=000000005caeecf1000000001dbde610
Output for 5.6.8
this=A hash=0000000075c4c5e20000000000693073 this=B hash=0000000075c4c5e10000000000693073
Output for 5.5.35
this=A hash=0000000071e3c02e000000007c677469 this=B hash=0000000071e3c02d000000007c677469
Output for 5.5.34
this=A hash=0000000007151a990000000045676cae this=B hash=0000000007151a9a0000000045676cae
Output for 5.5.33
this=A hash=0000000017a6206a000000001ac03106 this=B hash=0000000017a62069000000001ac03106
Output for 5.5.32
this=A hash=0000000057bb79a70000000031237305 this=B hash=0000000057bb79a40000000031237305
Output for 5.5.31
this=A hash=000000005b2ef4a500000000315799fb this=B hash=000000005b2ef4a600000000315799fb
Output for 5.5.30
this=A hash=000000004bd33ab60000000051d551b2 this=B hash=000000004bd33ab50000000051d551b2
Output for 5.5.29
this=A hash=0000000054279e550000000036a9bae8 this=B hash=0000000054279e560000000036a9bae8
Output for 5.5.28
this=A hash=000000001ddaa4490000000014941c81 this=B hash=000000001ddaa44a0000000014941c81
Output for 5.5.27
this=A hash=000000002b85e57f0000000032e208af this=B hash=000000002b85e57c0000000032e208af
Output for 5.5.26
this=A hash=0000000022e3e77100000000041341b1 this=B hash=0000000022e3e77200000000041341b1
Output for 5.5.25
this=A hash=0000000063703ef20000000005cd427f this=B hash=0000000063703ef10000000005cd427f
Output for 5.5.24
this=A hash=000000005ccf94fc0000000067afadea this=B hash=000000005ccf94ff0000000067afadea
Output for 5.4.45
this=A hash=0000000016f91e460000000064d94d96 this=B hash=0000000016f91e450000000064d94d96
Output for 5.4.44
this=A hash=000000003b5be32200000000730c838f this=B hash=000000003b5be32100000000730c838f
Output for 5.4.43
this=A hash=00000000033cdfa50000000046c1e4f1 this=B hash=00000000033cdfa60000000046c1e4f1
Output for 5.4.42
this=A hash=0000000052be1a26000000007968aa6c this=B hash=0000000052be1a25000000007968aa6c
Output for 5.4.41
this=A hash=000000002017efb7000000000f1262f6 this=B hash=000000002017efb4000000000f1262f6
Output for 5.4.40
this=A hash=000000004bfadf27000000006e6c3201 this=B hash=000000004bfadf24000000006e6c3201
Output for 5.4.39
this=A hash=000000000c9d6b65000000002c87ff7a this=B hash=000000000c9d6b66000000002c87ff7a
Output for 5.4.38
this=A hash=00000000529a40f0000000003c9fa4d7 this=B hash=00000000529a40f3000000003c9fa4d7
Output for 5.4.37
this=A hash=0000000073f30606000000000beda387 this=B hash=0000000073f30605000000000beda387
Output for 5.4.36
this=A hash=000000004ea9df06000000007402ea45 this=B hash=000000004ea9df05000000007402ea45
Output for 5.4.35
this=A hash=0000000056e9887000000000480acb60 this=B hash=0000000056e9887300000000480acb60
Output for 5.4.34
this=A hash=000000006c8b073e0000000066da05b0 this=B hash=000000006c8b073d0000000066da05b0
Output for 5.4.32
this=A hash=000000004342acfe00000000274f0294 this=B hash=000000004342acfd00000000274f0294
Output for 5.4.31
this=A hash=000000002596b1ce000000006c9f2da0 this=B hash=000000002596b1cd000000006c9f2da0
Output for 5.4.30
this=A hash=0000000025440d220000000057182a7d this=B hash=0000000025440d210000000057182a7d
Output for 5.4.29
this=A hash=0000000006a6f0d8000000004b964b7d this=B hash=0000000006a6f0db000000004b964b7d
Output for 5.4.28
this=A hash=000000007c3319a70000000026814ad6 this=B hash=000000007c3319a40000000026814ad6
Output for 5.4.27
this=A hash=000000003c15a215000000001434b845 this=B hash=000000003c15a216000000001434b845
Output for 5.4.26
this=A hash=000000003bbadc4400000000697d8e7f this=B hash=000000003bbadc4700000000697d8e7f
Output for 5.4.25
this=A hash=00000000370a10a9000000003f5d1c1b this=B hash=00000000370a10aa000000003f5d1c1b
Output for 5.4.24
this=A hash=0000000038e7f0280000000033e0648c this=B hash=0000000038e7f02b0000000033e0648c
Output for 5.4.23
this=A hash=000000005759e379000000007b300fd0 this=B hash=000000005759e37a000000007b300fd0
Output for 5.4.22
this=A hash=000000003630e406000000002486f6cc this=B hash=000000003630e405000000002486f6cc
Output for 5.4.21
this=A hash=0000000059214f360000000019adebac this=B hash=0000000059214f350000000019adebac
Output for 5.4.20
this=A hash=00000000692cd0060000000050781149 this=B hash=00000000692cd0050000000050781149
Output for 5.4.19
this=A hash=0000000034e65c59000000006f2f138c this=B hash=0000000034e65c5a000000006f2f138c
Output for 5.4.18
this=A hash=000000005c7cfba6000000000a0e546d this=B hash=000000005c7cfba5000000000a0e546d
Output for 5.4.17
this=A hash=00000000168dce0b000000000b7ffc3a this=B hash=00000000168dce08000000000b7ffc3a
Output for 5.4.16
this=A hash=0000000033f582c1000000002e19e397 this=B hash=0000000033f582c2000000002e19e397
Output for 5.4.15
this=A hash=00000000380a669b0000000040203089 this=B hash=00000000380a66980000000040203089
Output for 5.4.14
this=A hash=0000000044f47e73000000002632ce1c this=B hash=0000000044f47e70000000002632ce1c
Output for 5.4.13
this=A hash=000000006a127058000000002b64e2a4 this=B hash=000000006a12705b000000002b64e2a4
Output for 5.4.12
this=A hash=0000000012da660600000000470a8f0f this=B hash=0000000012da660500000000470a8f0f
Output for 5.4.11
this=A hash=0000000053f7faf500000000657b8242 this=B hash=0000000053f7faf600000000657b8242
Output for 5.4.10
this=A hash=00000000509d05b0000000005b01a700 this=B hash=00000000509d05b3000000005b01a700
Output for 5.4.9
this=A hash=00000000735eefaf0000000023b14ff4 this=B hash=00000000735eefac0000000023b14ff4
Output for 5.4.8
this=A hash=000000007f03dd1d000000007de9e90f this=B hash=000000007f03dd1e000000007de9e90f
Output for 5.4.7
this=A hash=0000000038efd3f4000000006f3d85cf this=B hash=0000000038efd3f7000000006f3d85cf
Output for 5.4.6
this=A hash=000000007fda162b0000000047bf8b15 this=B hash=000000007fda16280000000047bf8b15
Output for 5.4.5
this=A hash=000000001799a456000000003e921aec this=B hash=000000001799a455000000003e921aec
Output for 5.4.4
this=A hash=0000000058b5842d0000000028777eaa this=B hash=0000000058b5842e0000000028777eaa
Output for 5.4.3
this=A hash=00000000319ae0d2000000005725d6dd this=B hash=00000000319ae0d1000000005725d6dd
Output for 5.4.2
this=A hash=0000000001b7b64300000000264e3706 this=B hash=0000000001b7b64000000000264e3706
Output for 5.4.1
this=A hash=000000001c8c36ad000000001dee08fe this=B hash=000000001c8c36ae000000001dee08fe
Output for 5.3.29
this=A hash=000000006507f9c100000000722f870f this=B hash=000000006507f9c200000000722f870f
Output for 5.3.28
this=A hash=00000000156831000000000051ef9cca this=B hash=00000000156831030000000051ef9cca
Output for 5.3.27
this=A hash=0000000058ae26c1000000000e604620 this=B hash=0000000058ae26c2000000000e604620
Output for 5.3.26
this=A hash=0000000027d107a90000000059be4b7f this=B hash=0000000027d107aa0000000059be4b7f
Output for 5.3.25
this=A hash=00000000140abb980000000070828899 this=B hash=00000000140abb9b0000000070828899
Output for 5.3.24
this=A hash=000000000991d3fd0000000001a7a790 this=B hash=000000000991d3fe0000000001a7a790
Output for 5.3.23
this=A hash=000000006f54cc520000000079a4d665 this=B hash=000000006f54cc510000000079a4d665
Output for 5.3.22
this=A hash=00000000701dd8e20000000023378956 this=B hash=00000000701dd8e10000000023378956
Output for 5.3.21
this=A hash=000000003900021c0000000030db69b0 this=B hash=000000003900021f0000000030db69b0
Output for 5.3.20
this=A hash=000000006e81b5f0000000000afc66b9 this=B hash=000000006e81b5f3000000000afc66b9
Output for 5.3.19
this=A hash=0000000074d64879000000004fc5a45f this=B hash=0000000074d6487a000000004fc5a45f
Output for 5.3.18
this=A hash=000000006c05afbb000000007cb13f3c this=B hash=000000006c05afb8000000007cb13f3c