3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar = 'baz'; } $foo = new Foo(); echo spl_object_hash($foo); $reader = function & ($object, $property) { $value = & Closure::bind(function & () use ($property) { return $this->$property; }, $object, $object)->__invoke(); return $value; }; $bar = & $reader($foo, 'bar'); //var_dump($bar); $bar = 'tab1'; unset($bar); echo spl_object_hash($foo); var_dump($foo);
based on TB6Xb
Output for 7.2.0
000000001d12cf7000000000713e0b2f000000001d12cf7000000000713e0b2fobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.1.10
0000000050cb111b0000000010a3d6cd0000000050cb111b0000000010a3d6cdobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.1.7
0000000032397a97000000002fae05170000000032397a97000000002fae0517object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.1.6
000000000592ff4600000000281fcd74000000000592ff4600000000281fcd74object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.1.5
000000004e2d98ba00000000643f992d000000004e2d98ba00000000643f992dobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.1.0
00000000220b4e0e000000001567222700000000220b4e0e0000000015672227object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.20
00000000317a508f0000000046d10c4a00000000317a508f0000000046d10c4aobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.6
000000007e73960e000000004b54ce6b000000007e73960e000000004b54ce6bobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.5
000000003e99df6f0000000052435e1f000000003e99df6f0000000052435e1fobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.4
000000007abf3c8b000000004621dc05000000007abf3c8b000000004621dc05object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.3
00000000357a5fc1000000007ecda19000000000357a5fc1000000007ecda190object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.2
000000006ce4b84d00000000759474a0000000006ce4b84d00000000759474a0object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.1
000000000d32832200000000093bbdda000000000d32832200000000093bbddaobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 7.0.0
000000007b25726d000000004784de70000000007b25726d000000004784de70object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.28
0000000036a17373000000007ba2f7260000000036a17373000000007ba2f726object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.21
000000001b81e0a0000000003cbe516f000000001b81e0a0000000003cbe516fobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.20
0000000030d62e6e000000006a53ec210000000030d62e6e000000006a53ec21object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.19
0000000020487353000000005e2573ec0000000020487353000000005e2573ecobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.18
000000000c24dc2e000000003f41b883000000000c24dc2e000000003f41b883object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.17
000000007e15ecb4000000000fb19952000000007e15ecb4000000000fb19952object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.16
0000000039eb51370000000067bab0bb0000000039eb51370000000067bab0bbobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.15
0000000045f713a7000000001dd84c1e0000000045f713a7000000001dd84c1eobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.14
00000000384fa2500000000070bc06e100000000384fa2500000000070bc06e1object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.13
000000007f02aa6f00000000173a8c55000000007f02aa6f00000000173a8c55object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.12
0000000077d856420000000041cbe7cb0000000077d856420000000041cbe7cbobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.11
000000005ef18457000000000db6c125000000005ef18457000000000db6c125object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.10
000000007aa79a620000000061050ffb000000007aa79a620000000061050ffbobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.9
0000000007f48b4900000000797851930000000007f48b490000000079785193object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.6.8
000000007edbac60000000000a1a5f26000000007edbac60000000000a1a5f26object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.35
00000000512ba1230000000025d8dd3900000000512ba1230000000025d8dd39object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.34
00000000091452ec00000000715f5f1f00000000091452ec00000000715f5f1fobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.33
000000007ba594c6000000000d492e16000000007ba594c6000000000d492e16object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.32
000000002941d8ca000000004bd5a762000000002941d8ca000000004bd5a762object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.31
000000005cc2c425000000006430e0fb000000005cc2c425000000006430e0fbobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.30
0000000071d717db00000000051ea4470000000071d717db00000000051ea447object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.29
0000000009e980c200000000375e32e00000000009e980c200000000375e32e0object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.28
000000004a4ac72a0000000079666a50000000004a4ac72a0000000079666a50object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.27
000000001f1c4790000000002147290e000000001f1c4790000000002147290eobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.26
0000000048de7dde0000000031ace1580000000048de7dde0000000031ace158object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.25
00000000478862370000000006ab805200000000478862370000000006ab8052object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.5.24
000000004269e0a4000000000565c58b000000004269e0a4000000000565c58bobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.45
00000000781ad97c0000000037ae7fde00000000781ad97c0000000037ae7fdeobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.44
0000000058da30250000000038e4b49d0000000058da30250000000038e4b49dobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.43
00000000370292f8000000005c05466300000000370292f8000000005c054663object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.42
000000001c4c31ec000000003d3458c5000000001c4c31ec000000003d3458c5object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.41
000000005dfe54cc0000000056ed84d0000000005dfe54cc0000000056ed84d0object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.40
000000006a66c14200000000588e3377000000006a66c14200000000588e3377object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.39
000000000c1b2ea9000000006b6a990c000000000c1b2ea9000000006b6a990cobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.38
0000000053820353000000000c79f2190000000053820353000000000c79f219object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.37
0000000012ddc33d000000007395f8030000000012ddc33d000000007395f803object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.36
0000000057e22ca700000000624996ff0000000057e22ca700000000624996ffobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.35
000000001809a0b700000000560839a1000000001809a0b700000000560839a1object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.34
0000000075b6fc790000000079f30cb40000000075b6fc790000000079f30cb4object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.32
0000000018793a42000000007cbe54720000000018793a42000000007cbe5472object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.31
000000006cda872c00000000215683df000000006cda872c00000000215683dfobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.30
0000000026fa3778000000004d7b136f0000000026fa3778000000004d7b136fobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.29
0000000039fb7ea50000000066dc91500000000039fb7ea50000000066dc9150object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.28
000000002ea94565000000006da4dd86000000002ea94565000000006da4dd86object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.27
00000000587d19dd0000000077d65e6a00000000587d19dd0000000077d65e6aobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.26
00000000561c20a3000000001ab21f2300000000561c20a3000000001ab21f23object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.25
00000000436fae800000000057b4e25100000000436fae800000000057b4e251object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.24
000000006143ca930000000063861a0a000000006143ca930000000063861a0aobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.23
00000000431f5d02000000003d4ba96b00000000431f5d02000000003d4ba96bobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.22
000000000ca5d24b00000000147ec012000000000ca5d24b00000000147ec012object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.21
00000000073e8079000000002565b64900000000073e8079000000002565b649object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.20
000000001b72ee1a000000005452f7e5000000001b72ee1a000000005452f7e5object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.19
000000001899fc90000000006f504805000000001899fc90000000006f504805object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.18
000000001dd9a28100000000683bf9f9000000001dd9a28100000000683bf9f9object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.17
000000003216499b0000000049b7a762000000003216499b0000000049b7a762object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.16
000000000b45f1100000000054cb0386000000000b45f1100000000054cb0386object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.15
0000000003b80d7d0000000061fc629a0000000003b80d7d0000000061fc629aobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.14
000000000718c96b0000000034e0effb000000000718c96b0000000034e0effbobject(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.13
000000007a360b0f0000000041d9e041000000007a360b0f0000000041d9e041object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.4.12
000000000f007a3c000000000febcfd1000000000f007a3c000000000febcfd1object(Foo)#1 (1) { ["bar":"Foo":private]=> string(4) "tab1" }
Output for 5.3.29
000000002ffae4e9000000003ab4afd5 Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.28
000000003ee230400000000060617924 Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.27
000000002bd18969000000004e0c5c61 Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.26
0000000012902e000000000042ca0e4d Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.25
000000007ec78e280000000024293ac0 Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.24
000000002f7a371b000000000264520f Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.23
000000004448a036000000005e1a0b02 Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.
Output for 5.3.22
000000004000e006000000004e2af73b Fatal error: Call to undefined method Closure::bind() in /in/Kj8nc on line 12
Process exited with code 255.