3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Bar {} class Foo { private $bar; public function __construct(Bar $bar) { $this->bar = $bar; } public function print() { echo spl_object_hash($this->bar); echo "\n"; } } $b = new Bar(); $f1 = new Foo($b); $f2 = clone $f1; $f1->print(); $f2->print();
Output for 7.3.0beta1
00000000485fabdc000000004ce4984b 00000000485fabdc000000004ce4984b
Output for 7.3.0alpha1
000000004ca67554000000004552eac6 000000004ca67554000000004552eac6
Output for 7.2.6
000000001b71945f000000001f8fa219 000000001b71945f000000001f8fa219
Output for 7.2.5
00000000111cba60000000001bd3f487 00000000111cba60000000001bd3f487
Output for 7.2.0
0000000004ddefc1000000007836a22b 0000000004ddefc1000000007836a22b
Output for 7.1.20
000000005c1352fc00000000125b3d85 000000005c1352fc00000000125b3d85
Output for 7.1.7
000000001ff1c9c50000000010567425 000000001ff1c9c50000000010567425
Output for 7.1.6
00000000576de22b00000000062a9ae6 00000000576de22b00000000062a9ae6
Output for 7.1.5
000000006a662b49000000004ca939ed 000000006a662b49000000004ca939ed
Output for 7.1.0
000000003360f8fa0000000070d8ffd1 000000003360f8fa0000000070d8ffd1
Output for 7.0.20
00000000178f255c00000000030f4402 00000000178f255c00000000030f4402
Output for 7.0.9
0000000000234cca0000000053126d02 0000000000234cca0000000053126d02
Output for 7.0.8
000000005a0d407800000000166a3daa 000000005a0d407800000000166a3daa
Output for 7.0.7
000000001e3ffca9000000000fbc2043 000000001e3ffca9000000000fbc2043
Output for 7.0.6
00000000542d3fca00000000045d8ad9 00000000542d3fca00000000045d8ad9
Output for 7.0.5
0000000005d4bb4d000000005b31d9d5 0000000005d4bb4d000000005b31d9d5
Output for 7.0.4
0000000052d3e32100000000397351ba 0000000052d3e32100000000397351ba
Output for 7.0.3
000000000551a467000000006104b18b 000000000551a467000000006104b18b
Output for 7.0.2
00000000545ff53e00000000027141f4 00000000545ff53e00000000027141f4
Output for 7.0.1
000000006474be7400000000444e34a8 000000006474be7400000000444e34a8
Output for 7.0.0
000000003db49fa8000000004987a0c9 000000003db49fa8000000004987a0c9
Output for 5.6.0 - 5.6.24
Parse error: syntax error, unexpected 'print' (T_PRINT), expecting identifier (T_STRING) in /in/msfmP on line 12
Process exited with code 255.