3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php trait t { public static $setSelf; public static $setStatic; public static function setIt(){ $number = mt_rand(1,100); self::$setSelf = $number; static::$setStatic = $number; } }; class foo { use t; } class bar extends foo { } t::setIt(); foo::setIt(); bar::setIt(); var_dump(t::$setSelf); var_dump(t::$setStatic); var_dump(foo::$setSelf); var_dump(foo::$setStatic); var_dump(bar::$setSelf); var_dump(bar::$setStatic); //t::dump(); //foo::dump(); //bar::dump();
Output for 7.1.0
int(30) int(30) int(88) int(88) int(88) int(88)
Output for 7.0.14
int(64) int(64) int(21) int(21) int(21) int(21)
Output for 7.0.10
int(100) int(100) int(34) int(34) int(34) int(34)
Output for 7.0.9
int(69) int(69) int(34) int(34) int(34) int(34)
Output for 7.0.8
int(45) int(45) int(61) int(61) int(61) int(61)
Output for 7.0.7
int(13) int(13) int(75) int(75) int(75) int(75)
Output for 7.0.6
int(69) int(69) int(2) int(2) int(2) int(2)
Output for 7.0.5
int(12) int(12) int(99) int(99) int(99) int(99)
Output for 7.0.4
int(86) int(86) int(14) int(14) int(14) int(14)
Output for 7.0.3
int(60) int(60) int(30) int(30) int(30) int(30)
Output for 7.0.2
int(76) int(76) int(18) int(18) int(18) int(18)
Output for 7.0.1
int(22) int(22) int(37) int(37) int(37) int(37)
Output for 7.0.0
int(67) int(67) int(35) int(35) int(35) int(35)
Output for hhvm-3.12.0
int(17) int(17) int(24) int(24) int(24) int(24)
Output for hhvm-3.10.0
int(11) int(11) int(11) int(11) int(11) int(11)
Output for 5.6.28
int(8) int(8) int(20) int(20) int(20) int(20)
Output for 5.6.25
int(56) int(56) int(64) int(64) int(64) int(64)
Output for 5.6.24
int(89) int(89) int(72) int(72) int(72) int(72)
Output for 5.6.23
int(28) int(28) int(20) int(20) int(20) int(20)
Output for 5.6.22
int(93) int(93) int(53) int(53) int(53) int(53)
Output for 5.6.21
int(60) int(60) int(65) int(65) int(65) int(65)
Output for 5.6.20
int(91) int(91) int(21) int(21) int(21) int(21)
Output for 5.6.19
int(1) int(1) int(75) int(75) int(75) int(75)
Output for 5.6.18
int(4) int(4) int(1) int(1) int(1) int(1)
Output for 5.6.17
int(5) int(5) int(14) int(14) int(14) int(14)
Output for 5.6.16
int(56) int(56) int(39) int(39) int(39) int(39)
Output for 5.6.15
int(23) int(23) int(89) int(89) int(89) int(89)
Output for 5.6.14
int(56) int(56) int(63) int(63) int(63) int(63)
Output for 5.6.13
int(83) int(83) int(51) int(51) int(51) int(51)
Output for 5.6.12
int(24) int(24) int(67) int(67) int(67) int(67)
Output for 5.6.11
int(33) int(33) int(90) int(90) int(90) int(90)
Output for 5.6.10
int(45) int(45) int(94) int(94) int(94) int(94)
Output for 5.6.9
int(51) int(51) int(70) int(70) int(70) int(70)
Output for 5.6.8
int(51) int(51) int(56) int(56) int(56) int(56)
Output for 5.6.7
int(16) int(16) int(86) int(86) int(86) int(86)
Output for 5.6.6
int(87) int(87) int(98) int(98) int(98) int(98)
Output for 5.6.5
int(31) int(31) int(42) int(42) int(42) int(42)
Output for 5.6.4
int(68) int(68) int(15) int(15) int(15) int(15)
Output for 5.6.3
int(93) int(93) int(27) int(27) int(27) int(27)
Output for 5.6.2
int(7) int(7) int(95) int(95) int(95) int(95)
Output for 5.6.1
int(18) int(18) int(24) int(24) int(24) int(24)
Output for 5.6.0
int(32) int(32) int(43) int(43) int(43) int(43)
Output for 5.5.38
int(85) int(85) int(12) int(12) int(12) int(12)
Output for 5.4.39, 5.5.37
int(27) int(27) int(8) int(8) int(8) int(8)
Output for 5.5.36
int(64) int(64) int(85) int(85) int(85) int(85)
Output for 5.5.35
int(92) int(92) int(76) int(76) int(76) int(76)
Output for 5.5.34
int(59) int(59) int(85) int(85) int(85) int(85)
Output for 5.5.33
int(8) int(8) int(37) int(37) int(37) int(37)
Output for 5.5.32
int(31) int(31) int(66) int(66) int(66) int(66)
Output for 5.5.31
int(16) int(16) int(81) int(81) int(81) int(81)
Output for 5.5.30
int(66) int(66) int(53) int(53) int(53) int(53)
Output for 5.5.29
int(20) int(20) int(56) int(56) int(56) int(56)
Output for 5.5.28
int(8) int(8) int(35) int(35) int(35) int(35)
Output for 5.5.27
int(64) int(64) int(4) int(4) int(4) int(4)
Output for 5.5.26
int(36) int(36) int(87) int(87) int(87) int(87)
Output for 5.5.25
int(7) int(7) int(16) int(16) int(16) int(16)
Output for 5.5.24
int(61) int(61) int(1) int(1) int(1) int(1)
Output for 5.5.23
int(6) int(6) int(88) int(88) int(88) int(88)
Output for 5.5.22
int(79) int(79) int(8) int(8) int(8) int(8)
Output for 5.5.21
int(44) int(44) int(99) int(99) int(99) int(99)
Output for 5.5.20
int(11) int(11) int(65) int(65) int(65) int(65)
Output for 5.5.19
int(16) int(16) int(19) int(19) int(19) int(19)
Output for 5.5.18
int(93) int(93) int(88) int(88) int(88) int(88)
Output for 5.5.16
int(19) int(19) int(57) int(57) int(57) int(57)
Output for 5.4.2, 5.5.15
int(70) int(70) int(13) int(13) int(13) int(13)
Output for 5.5.14
int(45) int(45) int(52) int(52) int(52) int(52)
Output for 5.5.13
int(27) int(27) int(23) int(23) int(23) int(23)
Output for 5.5.12
int(72) int(72) int(99) int(99) int(99) int(99)
Output for 5.5.11
int(7) int(7) int(71) int(71) int(71) int(71)
Output for 5.5.10
int(95) int(95) int(88) int(88) int(88) int(88)
Output for 5.5.9
int(50) int(50) int(52) int(52) int(52) int(52)
Output for 5.5.8
int(70) int(70) int(50) int(50) int(50) int(50)
Output for 5.5.7
int(68) int(68) int(57) int(57) int(57) int(57)
Output for 5.5.6
int(94) int(94) int(9) int(9) int(9) int(9)
Output for 5.5.5
int(27) int(27) int(40) int(40) int(40) int(40)
Output for 5.5.4
int(40) int(40) int(74) int(74) int(74) int(74)
Output for 5.5.3
int(34) int(34) int(99) int(99) int(99) int(99)
Output for 5.5.2
int(94) int(94) int(63) int(63) int(63) int(63)
Output for 5.5.1
int(1) int(1) int(99) int(99) int(99) int(99)
Output for 5.5.0
int(15) int(15) int(90) int(90) int(90) int(90)
Output for 5.4.45
int(68) int(68) int(71) int(71) int(71) int(71)
Output for 5.4.44
int(79) int(79) int(70) int(70) int(70) int(70)
Output for 5.4.43
int(56) int(56) int(55) int(55) int(55) int(55)
Output for 5.4.42
int(97) int(97) int(57) int(57) int(57) int(57)
Output for 5.4.41
int(50) int(50) int(5) int(5) int(5) int(5)
Output for 5.4.40
int(36) int(36) int(38) int(38) int(38) int(38)
Output for 5.4.38
int(29) int(29) int(36) int(36) int(36) int(36)
Output for 5.4.37
int(16) int(16) int(2) int(2) int(2) int(2)
Output for 5.4.36
int(82) int(82) int(68) int(68) int(68) int(68)
Output for 5.4.35
int(8) int(8) int(91) int(91) int(91) int(91)
Output for 5.4.34
int(61) int(61) int(49) int(49) int(49) int(49)
Output for 5.4.32
int(27) int(27) int(61) int(61) int(61) int(61)
Output for 5.4.31
int(27) int(27) int(69) int(69) int(69) int(69)
Output for 5.4.30
int(36) int(36) int(78) int(78) int(78) int(78)
Output for 5.4.29
int(63) int(63) int(33) int(33) int(33) int(33)
Output for 5.4.28
int(30) int(30) int(41) int(41) int(41) int(41)
Output for 5.4.27
int(52) int(52) int(66) int(66) int(66) int(66)
Output for 5.4.26
int(87) int(87) int(42) int(42) int(42) int(42)
Output for 5.4.25
int(66) int(66) int(40) int(40) int(40) int(40)
Output for 5.4.24
int(19) int(19) int(68) int(68) int(68) int(68)
Output for 5.4.23
int(91) int(91) int(5) int(5) int(5) int(5)
Output for 5.4.22
int(52) int(52) int(61) int(61) int(61) int(61)
Output for 5.4.21
int(48) int(48) int(70) int(70) int(70) int(70)
Output for 5.4.20
int(4) int(4) int(69) int(69) int(69) int(69)
Output for 5.4.19
int(67) int(67) int(38) int(38) int(38) int(38)
Output for 5.4.18
int(25) int(25) int(89) int(89) int(89) int(89)
Output for 5.4.17
int(33) int(33) int(28) int(28) int(28) int(28)
Output for 5.4.16
int(53) int(53) int(66) int(66) int(66) int(66)
Output for 5.4.15
int(49) int(49) int(22) int(22) int(22) int(22)
Output for 5.4.14
int(90) int(90) int(49) int(49) int(49) int(49)
Output for 5.4.13
int(2) int(2) int(44) int(44) int(44) int(44)
Output for 5.4.12
int(43) int(43) int(71) int(71) int(71) int(71)
Output for 5.4.11
int(64) int(64) int(52) int(52) int(52) int(52)
Output for 5.4.10
int(8) int(8) int(98) int(98) int(98) int(98)
Output for 5.4.9
int(66) int(66) int(17) int(17) int(17) int(17)
Output for 5.4.8
int(32) int(32) int(37) int(37) int(37) int(37)
Output for 5.4.7
int(73) int(73) int(38) int(38) int(38) int(38)
Output for 5.4.6
int(4) int(4) int(73) int(73) int(73) int(73)
Output for 5.4.5
int(46) int(46) int(68) int(68) int(68) int(68)
Output for 5.4.4
int(96) int(96) int(3) int(3) int(3) int(3)
Output for 5.4.3
int(29) int(29) int(52) int(52) int(52) int(52)
Output for 5.4.1
int(34) int(34) int(11) int(11) int(11) int(11)
Output for 5.4.0
int(98) int(98) int(76) int(76) int(76) int(76)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/MMkja on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/MMkja on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/MMkja on line 2
Process exited with code 255.