3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new StdClass(); $b = new StdClass(); $array1 = array($a, $a, $b); $array2 = array($a, $b, $b); function countHashes ($array) { $count = array(); foreach ($array as $val) { $hash = spl_object_hash($val); if (! isset($count[$hash])) { $count[$hash] = 0; } } $count[$hash]++; return $count; }; $count1 = countHashes($array1); $count2 = countHashes($array2); if (count($count1) === count($count2)) { foreach ($count1 as $key => $value) { echo $key . " and " . $value . "\n"; if ($count2[$key] !== $value) { echo 'not the same!'; } } }
Output for 7.1.0
000000001ee32e830000000048c3fd8d and 0 000000001ee32e800000000048c3fd8d and 1
Output for 7.0.14
00000000613ac54b000000005f770ba9 and 0 00000000613ac548000000005f770ba9 and 1
Output for 7.0.6
000000000fac68820000000054e80ebd and 0 000000000fac68810000000054e80ebd and 1
Output for 7.0.5
0000000047ac691f00000000560e8ad4 and 0 0000000047ac691c00000000560e8ad4 and 1
Output for 7.0.4
00000000003192280000000058904294 and 0 000000000031922b0000000058904294 and 1
Output for 7.0.3
000000003f22bab300000000144171d9 and 0 000000003f22bab000000000144171d9 and 1
Output for 7.0.2
0000000004ddb08600000000777562ce and 0 0000000004ddb08500000000777562ce and 1
Output for 7.0.1
0000000064adfebb000000001a6f795d and 0 0000000064adfeb8000000001a6f795d and 1
Output for 7.0.0
000000006fa07e8d000000004a19d730 and 0 000000006fa07e8e000000004a19d730 and 1
Output for hhvm-3.12.0
0000000000000000cdbe008949fb5cb6 and 0 0000000000000000cdbe008949fb5c96 and 1
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
0000000028eaa703000000003272db78 and 0 0000000028eaa700000000003272db78 and 1
Output for 5.6.21
000000002eb12611000000005f747fed and 0 000000002eb12612000000005f747fed and 1
Output for 5.6.20
000000005754c79a000000000d399f53 and 0 000000005754c799000000000d399f53 and 1
Output for 5.6.19
0000000058b8123100000000095436ba and 0 0000000058b8123200000000095436ba and 1
Output for 5.6.18
0000000035df77d80000000027e5700f and 0 0000000035df77db0000000027e5700f and 1
Output for 5.6.17
000000003304ea760000000016c34d37 and 0 000000003304ea750000000016c34d37 and 1
Output for 5.6.16
000000005c47e143000000004445aa61 and 0 000000005c47e140000000004445aa61 and 1
Output for 5.6.15
0000000027d14304000000007dae03ba and 0 0000000027d14307000000007dae03ba and 1
Output for 5.6.14
000000005f1dfa7c000000005c238bdf and 0 000000005f1dfa7f000000005c238bdf and 1
Output for 5.6.13
000000007d616489000000006947486d and 0 000000007d61648a000000006947486d and 1
Output for 5.6.12
0000000077f791d10000000061997585 and 0 0000000077f791d20000000061997585 and 1
Output for 5.6.11
000000001c820ed3000000006f1de5e1 and 0 000000001c820ed0000000006f1de5e1 and 1
Output for 5.6.10
000000000299fa78000000002cdd85cc and 0 000000000299fa7b000000002cdd85cc and 1
Output for 5.6.9
00000000010e34b100000000338cd560 and 0 00000000010e34b200000000338cd560 and 1
Output for 5.6.8
0000000079074c5c0000000075855a8d and 0 0000000079074c5f0000000075855a8d and 1
Output for 5.5.35
000000007be833ae000000005b802517 and 0 000000007be833ad000000005b802517 and 1
Output for 5.5.34
00000000207d9cf5000000004e099101 and 0 00000000207d9cf6000000004e099101 and 1
Output for 5.5.33
000000004b45cd190000000066cbdcfd and 0 000000004b45cd1a0000000066cbdcfd and 1
Output for 5.5.32
0000000072faf7d9000000000c5afa32 and 0 0000000072faf7da000000000c5afa32 and 1
Output for 5.5.31
000000005346d7b4000000003c40a541 and 0 000000005346d7b7000000003c40a541 and 1
Output for 5.5.30
000000004d6f0a370000000028a05fb8 and 0 000000004d6f0a340000000028a05fb8 and 1
Output for 5.5.29
000000003e1ff0e7000000002f21660d and 0 000000003e1ff0e4000000002f21660d and 1
Output for 5.5.28
0000000057f6fc79000000004ec6c37b and 0 0000000057f6fc7a000000004ec6c37b and 1
Output for 5.5.27
000000005c5b902a00000000211e08a3 and 0 000000005c5b902900000000211e08a3 and 1
Output for 5.5.26
00000000173cfd37000000005fc04693 and 0 00000000173cfd34000000005fc04693 and 1
Output for 5.5.25
000000002383cd1b00000000237f4b2c and 0 000000002383cd1800000000237f4b2c and 1
Output for 5.5.24
000000005cb45f7e0000000013dac151 and 0 000000005cb45f7d0000000013dac151 and 1
Output for 5.4.45
00000000646040a1000000000d4aeb30 and 0 00000000646040a2000000000d4aeb30 and 1
Output for 5.4.44
00000000732879010000000018309ac3 and 0 00000000732879020000000018309ac3 and 1
Output for 5.4.43
0000000079f3bfec00000000644a830b and 0 0000000079f3bfef00000000644a830b and 1
Output for 5.4.42
000000005d49b39600000000542beabd and 0 000000005d49b39500000000542beabd and 1
Output for 5.4.41
000000003e1bd6a3000000007e27ca7d and 0 000000003e1bd6a0000000007e27ca7d and 1
Output for 5.4.40
00000000753af36f000000001bdda5fe and 0 00000000753af36c000000001bdda5fe and 1
Output for 5.4.39
0000000052b765fd0000000004e3cf77 and 0 0000000052b765fe0000000004e3cf77 and 1
Output for 5.4.38
000000003751f1f200000000495545dd and 0 000000003751f1f100000000495545dd and 1
Output for 5.4.37
00000000241d31280000000001d4b952 and 0 00000000241d312b0000000001d4b952 and 1
Output for 5.4.36
000000007919e1350000000006e08d4d and 0 000000007919e1360000000006e08d4d and 1
Output for 5.4.35
000000004eb227ed000000007ed25b93 and 0 000000004eb227ee000000007ed25b93 and 1
Output for 5.4.34
0000000013bc540a0000000058b38448 and 0 0000000013bc54090000000058b38448 and 1
Output for 5.4.32
0000000018ee114e000000002cdd102d and 0 0000000018ee114d000000002cdd102d and 1
Output for 5.4.31
000000007d4fe179000000000a9f504c and 0 000000007d4fe17a000000000a9f504c and 1
Output for 5.4.30
0000000006fb6db70000000023d8caff and 0 0000000006fb6db40000000023d8caff and 1
Output for 5.4.29
0000000046e13fbe000000006ac62f1f and 0 0000000046e13fbd000000006ac62f1f and 1
Output for 5.4.28
000000003506f88c000000001e348e98 and 0 000000003506f88f000000001e348e98 and 1
Output for 5.4.27
0000000074dd538c0000000011eaf21f and 0 0000000074dd538f0000000011eaf21f and 1
Output for 5.4.26
000000001c1927bd00000000253ded98 and 0 000000001c1927be00000000253ded98 and 1
Output for 5.4.25
00000000115c2281000000000cac7340 and 0 00000000115c2282000000000cac7340 and 1
Output for 5.4.24
000000006be34f2d000000003ab4ce22 and 0 000000006be34f2e000000003ab4ce22 and 1
Output for 5.4.23
0000000045fd4419000000001bff8f88 and 0 0000000045fd441a000000001bff8f88 and 1
Output for 5.4.22
000000001bfb9f61000000005c5da7fc and 0 000000001bfb9f62000000005c5da7fc and 1
Output for 5.4.21
0000000077197fe3000000006a29d944 and 0 0000000077197fe0000000006a29d944 and 1
Output for 5.4.20
000000007a5016780000000030260ff1 and 0 000000007a50167b0000000030260ff1 and 1
Output for 5.4.19
000000000d233f70000000001ae38a4f and 0 000000000d233f73000000001ae38a4f and 1
Output for 5.4.18
000000001b7c26fa000000006ba6280a and 0 000000001b7c26f9000000006ba6280a and 1
Output for 5.4.17
0000000037d9e3220000000035659965 and 0 0000000037d9e3210000000035659965 and 1
Output for 5.4.16
0000000070497c7c000000006782a4ab and 0 0000000070497c7f000000006782a4ab and 1
Output for 5.4.15
0000000005d73ba0000000006f7354c9 and 0 0000000005d73ba3000000006f7354c9 and 1
Output for 5.4.14
000000003f1e12f7000000002c600463 and 0 000000003f1e12f4000000002c600463 and 1
Output for 5.4.13
0000000070ac9d040000000036523310 and 0 0000000070ac9d070000000036523310 and 1
Output for 5.4.12
000000003f3abd78000000002999a8b8 and 0 000000003f3abd7b000000002999a8b8 and 1
Output for 5.4.11
0000000010aeb2d1000000000740b9f0 and 0 0000000010aeb2d2000000000740b9f0 and 1
Output for 5.4.10
00000000210b4e67000000005b061243 and 0 00000000210b4e64000000005b061243 and 1
Output for 5.4.9
000000005a892d17000000000d2bf4c6 and 0 000000005a892d14000000000d2bf4c6 and 1
Output for 5.4.8
0000000022c79fda0000000052632f6a and 0 0000000022c79fd90000000052632f6a and 1
Output for 5.4.7
000000002b8a1a10000000002cb0e6c3 and 0 000000002b8a1a13000000002cb0e6c3 and 1
Output for 5.4.6
000000002e84bed000000000673a15ef and 0 000000002e84bed300000000673a15ef and 1
Output for 5.4.5
0000000001ce44f4000000006912daf1 and 0 0000000001ce44f7000000006912daf1 and 1
Output for 5.4.4
000000001f9034d20000000069f1c3d7 and 0 000000001f9034d10000000069f1c3d7 and 1
Output for 5.4.3
0000000078f13a3200000000716980c8 and 0 0000000078f13a3100000000716980c8 and 1
Output for 5.4.2
0000000004958aba00000000556e51fc and 0 0000000004958ab900000000556e51fc and 1
Output for 5.4.1
0000000023c7031a000000007e72c147 and 0 0000000023c70319000000007e72c147 and 1
Output for 5.4.0
0000000036a8eee20000000046a5a6d0 and 0 0000000036a8eee10000000046a5a6d0 and 1
Output for 5.3.29
0000000009f1055e0000000037a91520 and 0 0000000009f1055d0000000037a91520 and 1
Output for 5.3.28
000000007e0d3c7b000000007b1f8c1d and 0 000000007e0d3c78000000007b1f8c1d and 1
Output for 5.3.27
0000000063b20e89000000002fd6b843 and 0 0000000063b20e8a000000002fd6b843 and 1
Output for 5.3.26
000000006261cbec000000001cbecd5d and 0 000000006261cbef000000001cbecd5d and 1
Output for 5.3.25
000000007620661b000000004a5ae937 and 0 0000000076206618000000004a5ae937 and 1
Output for 5.3.24
0000000025b4e70400000000670cf309 and 0 0000000025b4e70700000000670cf309 and 1
Output for 5.3.23
000000001695adb4000000004d16d7f4 and 0 000000001695adb7000000004d16d7f4 and 1
Output for 5.3.22
00000000179527590000000002f7a21c and 0 000000001795275a0000000002f7a21c and 1
Output for 5.3.21
0000000047fa305400000000402dd7ee and 0 0000000047fa305700000000402dd7ee and 1
Output for 5.3.20
0000000003a8aeb700000000585a2af1 and 0 0000000003a8aeb400000000585a2af1 and 1
Output for 5.3.19
000000002b7035560000000067615d3a and 0 000000002b7035550000000067615d3a and 1
Output for 5.3.18
0000000033bd682f00000000383501db and 0 0000000033bd682c00000000383501db and 1
Output for 5.3.17
0000000011c75c6a00000000415fc535 and 0 0000000011c75c6900000000415fc535 and 1
Output for 5.3.16
00000000517ecf9b000000005e7c0c0f and 0 00000000517ecf98000000005e7c0c0f and 1
Output for 5.3.15
000000006d2529ef000000004a4fc831 and 0 000000006d2529ec000000004a4fc831 and 1
Output for 5.3.14
000000007803f072000000002c799491 and 0 000000007803f071000000002c799491 and 1
Output for 5.3.13
00000000434e0db9000000000da68376 and 0 00000000434e0dba000000000da68376 and 1
Output for 5.3.12
00000000078e479900000000524ba273 and 0 00000000078e479a00000000524ba273 and 1
Output for 5.3.11
000000007cdab3830000000036929f84 and 0 000000007cdab3800000000036929f84 and 1
Output for 5.3.10
000000003a67e6230000000011d6aa64 and 0 000000003a67e6200000000011d6aa64 and 1
Output for 5.3.9
000000007dcf8628000000000d61f37c and 0 000000007dcf862b000000000d61f37c and 1
Output for 5.3.8
000000007648605700000000623213a6 and 0 000000007648605400000000623213a6 and 1
Output for 5.3.7
0000000041ce5c4e00000000337712d9 and 0 0000000041ce5c4d00000000337712d9 and 1
Output for 5.3.6
000000007ee9ef9c000000001cf70245 and 0 000000007ee9ef9f000000001cf70245 and 1
Output for 5.3.5
0000000055c9a3ed0000000033cc2f29 and 0 0000000055c9a3ee0000000033cc2f29 and 1
Output for 5.3.4
0000000008125130000000002ff68e25 and 0 0000000008125133000000002ff68e25 and 1
Output for 5.3.3
0000000072f509d50000000035e3612c and 0 0000000072f509d60000000035e3612c and 1
Output for 5.3.2
0000000031d7c416000000007138c106 and 0 0000000031d7c415000000007138c106 and 1
Output for 5.3.1
000000003aed0f0400000000407f9f3d and 0 000000003aed0f0700000000407f9f3d and 1
Output for 5.3.0
000000002acee49900000000714beb9a and 0 000000002acee49a00000000714beb9a and 1
Output for 5.2.17
861a2f056a593edc2697eec710327754 and 0 1bc0c4441cc66a8d1bb41a8af7ae1e1c and 1
Output for 5.2.15 - 5.2.16
bab3da487bfe51e3bada7ed6962c83d7 and 0 56907a50a8e9c975d074d7b1009d5a74 and 1
Output for 5.2.14
6827d7150a80a95428b05b2dbc0dcb10 and 0 6020ade232c05125fb3382e3b26ec44b and 1
Output for 5.2.13
4d9da188dd696504eef8aed3fde97e02 and 0 332b22f9fcb62d8c8853f59a96cf0568 and 1
Output for 5.2.12
617357606fc417e758728410d8dad7f3 and 0 76f70bcddf428556b587cdd5bef0f40e and 1
Output for 5.2.9, 5.2.11
52ee78937c6a89104904aed13987318e and 0 7466004bf89a7ccbc9d57bbe23aee10f and 1
Output for 5.2.10
efe88f76f26081279f31ba49d381104e and 0 c9e7ad354f4391649e23480759c6653e and 1
Output for 5.2.7 - 5.2.8
af89ab9ae8be1068e0d8dc48e55bfcd1 and 0 211922ba75154e1c078b478e27988a06 and 1
Output for 5.2.6
950969556ed71c6f363f434ecae32954 and 0 8d62d4db96875809e27de28a778efc7c and 1
Output for 5.2.5
a7965ec2cba63ba225597f43def8a4b6 and 0 48d05d7abab6ca87f8a99c22534056d2 and 1
Output for 5.2.4
7ebbed9ad06ebcbd0c3782f6cdf89b51 and 0 905eb61e16b35c95f6ff5fbd1cac925b and 1
Output for 5.2.3
dc90896f8dce368265954f0524e2a853 and 0 35ebaf980762764da73312a19fb36caf and 1
Output for 5.2.2
d1877c094161b942518f0f010b1a5be5 and 0 55ba1e034ca9908ef2186f5ca57db953 and 1
Output for 5.2.1
5663e593b52467eb39485ab4532cfb71 and 0 c1357d69cdbf6a57522e24153241fcc4 and 1
Output for 5.2.0
73f03f2749114a53db076b2f4bc47285 and 0 37ce1a2271f4a9d32af6948919f26787 and 1
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function spl_object_hash() in /in/3VSni on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: spl_object_hash() in /in/3VSni on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: spl_object_hash() in /in/3VSni on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: spl_object_hash() in /in/3VSni on line 12