3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Singleton{ private static $instance; private function __construct(){} public static function instance() { if (is_null(self::$instance)){ self::$instance = new static; } return self::$instance; } } $obj1 = Singleton::instance(); $obj2 = Singleton::instance(); var_dump(spl_object_hash($obj1), spl_object_hash($obj2));
Output for 7.1.0
string(32) "000000006ab0e94a0000000040aab159" string(32) "000000006ab0e94a0000000040aab159"
Output for 7.0.14
string(32) "0000000019f9b17b000000004002ed65" string(32) "0000000019f9b17b000000004002ed65"
Output for 7.0.6
string(32) "000000004a6414d3000000000697b7c5" string(32) "000000004a6414d3000000000697b7c5"
Output for 7.0.5
string(32) "000000006e17350d000000003925baaa" string(32) "000000006e17350d000000003925baaa"
Output for 7.0.4
string(32) "000000003e54c81c000000002a4918c3" string(32) "000000003e54c81c000000002a4918c3"
Output for 7.0.3
string(32) "000000003398d4ad0000000058021c79" string(32) "000000003398d4ad0000000058021c79"
Output for 7.0.2
string(32) "0000000013b2c66700000000453d65d1" string(32) "0000000013b2c66700000000453d65d1"
Output for 7.0.1
string(32) "0000000028f013b5000000002bffa8e5" string(32) "0000000028f013b5000000002bffa8e5"
Output for 7.0.0
string(32) "000000005b44b171000000002e3b797e" string(32) "000000005b44b171000000002e3b797e"
Output for hhvm-3.12.0
string(32) "00000000000000004baf83f74aee698b" string(32) "00000000000000004baf83f74aee698b"
Output for hhvm-3.10.0
string(32) "00000000000000005ef7a1d1ec9fec10" string(32) "00000000000000005ef7a1d1ec9fec10"
Output for 5.6.28
string(32) "00000000179b3148000000000c631b29" string(32) "00000000179b3148000000000c631b29"
Output for 5.6.21
string(32) "000000003a91a7b6000000001673ef2b" string(32) "000000003a91a7b6000000001673ef2b"
Output for 5.6.20
string(32) "000000000a3b56ec0000000019a4d763" string(32) "000000000a3b56ec0000000019a4d763"
Output for 5.6.19
string(32) "000000001134a8510000000069071747" string(32) "000000001134a8510000000069071747"
Output for 5.6.18
string(32) "000000000c04bace000000000b500a5b" string(32) "000000000c04bace000000000b500a5b"
Output for 5.6.17
string(32) "000000003eb2f1f0000000000ac6ec86" string(32) "000000003eb2f1f0000000000ac6ec86"
Output for 5.6.16
string(32) "00000000310ef8cf00000000304d0992" string(32) "00000000310ef8cf00000000304d0992"
Output for 5.6.15
string(32) "000000006ea9a11d0000000064e708fd" string(32) "000000006ea9a11d0000000064e708fd"
Output for 5.6.14
string(32) "00000000618472f4000000002bbebd8d" string(32) "00000000618472f4000000002bbebd8d"
Output for 5.6.13
string(32) "0000000055fb22e5000000000b4f9dde" string(32) "0000000055fb22e5000000000b4f9dde"
Output for 5.6.12
string(32) "00000000176b2e5b000000000babf758" string(32) "00000000176b2e5b000000000babf758"
Output for 5.6.11
string(32) "000000001fad06c8000000005719fe56" string(32) "000000001fad06c8000000005719fe56"
Output for 5.6.10
string(32) "0000000040fb23260000000048dfa035" string(32) "0000000040fb23260000000048dfa035"
Output for 5.6.9
string(32) "000000005b00abe1000000007ee2a5b8" string(32) "000000005b00abe1000000007ee2a5b8"
Output for 5.6.8
string(32) "00000000599608af000000003d9ae53e" string(32) "00000000599608af000000003d9ae53e"
Output for 5.5.35
string(32) "000000005c59920e000000006529ba89" string(32) "000000005c59920e000000006529ba89"
Output for 5.5.34
string(32) "00000000043d6d500000000051b35291" string(32) "00000000043d6d500000000051b35291"
Output for 5.5.33
string(32) "0000000052cb8eaf000000005b89cc09" string(32) "0000000052cb8eaf000000005b89cc09"
Output for 5.5.32
string(32) "000000002becd4fb00000000329c6682" string(32) "000000002becd4fb00000000329c6682"
Output for 5.5.31
string(32) "00000000528ba5ae000000007cfa7350" string(32) "00000000528ba5ae000000007cfa7350"
Output for 5.5.30
string(32) "00000000426506fa000000007b59ad73" string(32) "00000000426506fa000000007b59ad73"
Output for 5.5.29
string(32) "00000000726f2101000000004347b224" string(32) "00000000726f2101000000004347b224"
Output for 5.5.28
string(32) "000000005cc607dd000000001e6ae329" string(32) "000000005cc607dd000000001e6ae329"
Output for 5.5.27
string(32) "000000007f2fec3e000000000b610fed" string(32) "000000007f2fec3e000000000b610fed"
Output for 5.5.26
string(32) "000000000825b30e0000000027def14e" string(32) "000000000825b30e0000000027def14e"
Output for 5.5.25
string(32) "0000000043ffa3d4000000000488bbd8" string(32) "0000000043ffa3d4000000000488bbd8"
Output for 5.5.24
string(32) "000000000538728400000000271f5839" string(32) "000000000538728400000000271f5839"
Output for 5.4.45
string(32) "000000007e44351d0000000046514fb1" string(32) "000000007e44351d0000000046514fb1"
Output for 5.4.44
string(32) "00000000446636390000000050d31573" string(32) "00000000446636390000000050d31573"
Output for 5.4.43
string(32) "000000002bd297230000000033802574" string(32) "000000002bd297230000000033802574"
Output for 5.4.42
string(32) "000000007bc014bc0000000046237e55" string(32) "000000007bc014bc0000000046237e55"
Output for 5.4.41
string(32) "00000000337e454a000000001027cea1" string(32) "00000000337e454a000000001027cea1"
Output for 5.4.40
string(32) "000000006c122e23000000007aa68860" string(32) "000000006c122e23000000007aa68860"
Output for 5.4.39
string(32) "00000000657500c500000000130d8b35" string(32) "00000000657500c500000000130d8b35"
Output for 5.4.38
string(32) "000000004174e0890000000049896b37" string(32) "000000004174e0890000000049896b37"
Output for 5.4.37
string(32) "000000003b719dc6000000007abae720" string(32) "000000003b719dc6000000007abae720"
Output for 5.4.36
string(32) "000000006f7873df0000000075d55eaf" string(32) "000000006f7873df0000000075d55eaf"
Output for 5.4.35
string(32) "000000000bd6934b000000007b1b1bfd" string(32) "000000000bd6934b000000007b1b1bfd"
Output for 5.4.34
string(32) "00000000690e6917000000006e9a741e" string(32) "00000000690e6917000000006e9a741e"
Output for 5.4.32
string(32) "000000007b589e1d000000003f296f16" string(32) "000000007b589e1d000000003f296f16"
Output for 5.4.31
string(32) "000000005529a6e40000000032caac1e" string(32) "000000005529a6e40000000032caac1e"
Output for 5.4.30
string(32) "000000002f4f37470000000058aff546" string(32) "000000002f4f37470000000058aff546"
Output for 5.4.29
string(32) "000000001b3a3cc90000000043b16be5" string(32) "000000001b3a3cc90000000043b16be5"
Output for 5.4.28
string(32) "0000000061d51f450000000006ea03e8" string(32) "0000000061d51f450000000006ea03e8"
Output for 5.4.27
string(32) "0000000041a5eb390000000071f8fb6d" string(32) "0000000041a5eb390000000071f8fb6d"
Output for 5.4.26
string(32) "000000001315f3f7000000000dcc1b3f" string(32) "000000001315f3f7000000000dcc1b3f"
Output for 5.4.25
string(32) "000000004baca9f40000000024e9108b" string(32) "000000004baca9f40000000024e9108b"
Output for 5.4.24
string(32) "0000000024111190000000006c15c572" string(32) "0000000024111190000000006c15c572"
Output for 5.4.23
string(32) "000000005a558b8700000000498d3226" string(32) "000000005a558b8700000000498d3226"
Output for 5.4.22
string(32) "00000000679e650f00000000149c9c1f" string(32) "00000000679e650f00000000149c9c1f"
Output for 5.4.21
string(32) "0000000036293b82000000006a0376f5" string(32) "0000000036293b82000000006a0376f5"
Output for 5.4.20
string(32) "00000000521fbd7a0000000016057b92" string(32) "00000000521fbd7a0000000016057b92"
Output for 5.4.19
string(32) "0000000035e4701700000000368cdcee" string(32) "0000000035e4701700000000368cdcee"
Output for 5.4.18
string(32) "000000001ad53eb60000000002725a41" string(32) "000000001ad53eb60000000002725a41"
Output for 5.4.17
string(32) "000000001c1d3a1a000000002665e629" string(32) "000000001c1d3a1a000000002665e629"
Output for 5.4.16
string(32) "00000000293e1258000000000934b1ee" string(32) "00000000293e1258000000000934b1ee"
Output for 5.4.15
string(32) "000000004415dab9000000007d5ec72d" string(32) "000000004415dab9000000007d5ec72d"
Output for 5.4.14
string(32) "00000000490e8a35000000001202c3df" string(32) "00000000490e8a35000000001202c3df"
Output for 5.4.13
string(32) "0000000066f685430000000036f95981" string(32) "0000000066f685430000000036f95981"
Output for 5.4.12
string(32) "0000000072c2155f000000006bb3df71" string(32) "0000000072c2155f000000006bb3df71"
Output for 5.4.11
string(32) "00000000620532670000000021dcc940" string(32) "00000000620532670000000021dcc940"
Output for 5.4.10
string(32) "0000000067060f7c000000002f38f682" string(32) "0000000067060f7c000000002f38f682"
Output for 5.4.9
string(32) "000000002b43f1330000000035a71ea6" string(32) "000000002b43f1330000000035a71ea6"
Output for 5.4.8
string(32) "000000000377cc220000000059740f99" string(32) "000000000377cc220000000059740f99"
Output for 5.4.7
string(32) "0000000029b4f60700000000717be5e9" string(32) "0000000029b4f60700000000717be5e9"
Output for 5.4.6
string(32) "0000000002a28a50000000006a1db510" string(32) "0000000002a28a50000000006a1db510"
Output for 5.4.5
string(32) "000000003e08d4ed0000000054c43de7" string(32) "000000003e08d4ed0000000054c43de7"
Output for 5.4.4
string(32) "0000000074d547f40000000071ef48c5" string(32) "0000000074d547f40000000071ef48c5"
Output for 5.4.3
string(32) "0000000067ff0751000000002a74d6bb" string(32) "0000000067ff0751000000002a74d6bb"
Output for 5.4.2
string(32) "00000000127fb94a00000000408fe16f" string(32) "00000000127fb94a00000000408fe16f"
Output for 5.4.1
string(32) "0000000032504cd0000000001da50128" string(32) "0000000032504cd0000000001da50128"
Output for 5.4.0
string(32) "000000001d8fbc6d000000003bb0539e" string(32) "000000001d8fbc6d000000003bb0539e"
Output for 5.3.29
string(32) "00000000462209c5000000006da6dfa0" string(32) "00000000462209c5000000006da6dfa0"
Output for 5.3.28
string(32) "0000000058c5092a000000007b0b6fa6" string(32) "0000000058c5092a000000007b0b6fa6"
Output for 5.3.27
string(32) "000000004ab4f64100000000181a493e" string(32) "000000004ab4f64100000000181a493e"
Output for 5.3.26
string(32) "0000000046cac8eb0000000065cb1f2f" string(32) "0000000046cac8eb0000000065cb1f2f"
Output for 5.3.25
string(32) "00000000348965620000000007f596ba" string(32) "00000000348965620000000007f596ba"
Output for 5.3.24
string(32) "0000000071abf52d000000003029e136" string(32) "0000000071abf52d000000003029e136"
Output for 5.3.23
string(32) "00000000139d64ae00000000018daace" string(32) "00000000139d64ae00000000018daace"
Output for 5.3.22
string(32) "0000000051a320a8000000001509a9d4" string(32) "0000000051a320a8000000001509a9d4"
Output for 5.3.21
string(32) "0000000008bbf08a00000000490ca9c0" string(32) "0000000008bbf08a00000000490ca9c0"
Output for 5.3.20
string(32) "00000000345326220000000005763f40" string(32) "00000000345326220000000005763f40"
Output for 5.3.19
string(32) "000000007cb49f070000000037facd3e" string(32) "000000007cb49f070000000037facd3e"
Output for 5.3.18
string(32) "000000003e227f6e00000000654742ef" string(32) "000000003e227f6e00000000654742ef"
Output for 5.3.17
string(32) "000000001fc270dc0000000062ec1705" string(32) "000000001fc270dc0000000062ec1705"
Output for 5.3.16
string(32) "0000000004e910a5000000003d96e81b" string(32) "0000000004e910a5000000003d96e81b"
Output for 5.3.15
string(32) "00000000122247c8000000000ad50459" string(32) "00000000122247c8000000000ad50459"
Output for 5.3.14
string(32) "0000000050db7fcb00000000549863ef" string(32) "0000000050db7fcb00000000549863ef"
Output for 5.3.13
string(32) "0000000009538ba70000000024b16e1a" string(32) "0000000009538ba70000000024b16e1a"
Output for 5.3.12
string(32) "000000005b66351c00000000347f1c51" string(32) "000000005b66351c00000000347f1c51"
Output for 5.3.11
string(32) "0000000065db0b6d00000000779661ea" string(32) "0000000065db0b6d00000000779661ea"
Output for 5.3.10
string(32) "000000003348eb4800000000611751ae" string(32) "000000003348eb4800000000611751ae"
Output for 5.3.9
string(32) "00000000474a4ae70000000005dff531" string(32) "00000000474a4ae70000000005dff531"
Output for 5.3.8
string(32) "00000000227916cd0000000033fa56ef" string(32) "00000000227916cd0000000033fa56ef"
Output for 5.3.7
string(32) "000000000c1253c50000000001b36997" string(32) "000000000c1253c50000000001b36997"
Output for 5.3.6
string(32) "000000007e45528a0000000012e1c03d" string(32) "000000007e45528a0000000012e1c03d"
Output for 5.3.5
string(32) "0000000000a76e390000000042a2848b" string(32) "0000000000a76e390000000042a2848b"
Output for 5.3.4
string(32) "00000000096d0855000000005c3a6fb5" string(32) "00000000096d0855000000005c3a6fb5"
Output for 5.3.3
string(32) "0000000046314c8300000000619eee48" string(32) "0000000046314c8300000000619eee48"
Output for 5.3.2
string(32) "000000000cd13e4c000000004943926b" string(32) "000000000cd13e4c000000004943926b"
Output for 5.3.1
string(32) "00000000409ec95c00000000176663df" string(32) "00000000409ec95c00000000176663df"
Output for 5.3.0
string(32) "000000007da426f30000000039953180" string(32) "000000007da426f30000000039953180"
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/hl6Pa on line 16
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/hl6Pa on line 16
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/hl6Pa on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/hl6Pa on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/hl6Pa on line 6
Process exited with code 255.