3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function id($x) { return $x; } class A { function foo() { echo 'a'; } } var_dump(PHP_VERSION_ID); if (PHP_VERSION_ID < 50400) { return id(new A())->foo(); } return (new A())->foo();
Output for 7.1.0
int(70100) a
Output for 7.0.14
int(70014) a
Output for 7.0.12
int(70012) a
Output for 7.0.6
int(70006) a
Output for 7.0.5
int(70005) a
Output for 7.0.4
int(70004) a
Output for 7.0.3
int(70003) a
Output for 7.0.2
int(70002) a
Output for 7.0.1
int(70001) a
Output for 7.0.0
int(70000) a
Output for 5.6.28
int(50628) a
Output for 5.6.21
int(50621) a
Output for 5.6.20
int(50620) a
Output for 5.6.19
int(50619) a
Output for 5.6.18
int(50618) a
Output for 5.6.17
int(50617) a
Output for 5.6.16
int(50616) a
Output for 5.6.15
int(50615) a
Output for 5.6.14
int(50614) a
Output for 5.6.13
int(50613) a
Output for 5.6.12
int(50612) a
Output for 5.6.11
int(50611) a
Output for 5.6.10
int(50610) a
Output for 5.6.9
int(50609) a
Output for 5.6.8
int(50608) a
Output for 5.6.7
int(50607) a
Output for 5.6.6
int(50606) a
Output for 5.6.5
int(50605) a
Output for 5.6.4
int(50604) a
Output for 5.6.3
int(50603) a
Output for 5.6.2
int(50602) a
Output for 5.6.1
int(50601) a
Output for 5.6.0
int(50600) a
Output for 5.5.35
int(50535) a
Output for 5.5.34
int(50534) a
Output for 5.5.33
int(50533) a
Output for 5.5.32
int(50532) a
Output for 5.5.31
int(50531) a
Output for 5.5.30
int(50530) a
Output for 5.5.29
int(50529) a
Output for 5.5.28
int(50528) a
Output for 5.5.27
int(50527) a
Output for 5.5.26
int(50526) a
Output for 5.5.25
int(50525) a
Output for 5.5.24
int(50524) a
Output for 5.5.23
int(50523) a
Output for 5.5.22
int(50522) a
Output for 5.5.21
int(50521) a
Output for 5.5.20
int(50520) a
Output for 5.5.19
int(50519) a
Output for 5.5.18
int(50518) a
Output for 5.5.16
int(50516) a
Output for 5.5.15
int(50515) a
Output for 5.5.14
int(50514) a
Output for 5.5.13
int(50513) a
Output for 5.5.12
int(50512) a
Output for 5.5.11
int(50511) a
Output for 5.5.10
int(50510) a
Output for 5.5.9
int(50509) a
Output for 5.5.8
int(50508) a
Output for 5.5.7
int(50507) a
Output for 5.5.6
int(50506) a
Output for 5.5.5
int(50505) a
Output for 5.5.4
int(50504) a
Output for 5.5.3
int(50503) a
Output for 5.5.2
int(50502) a
Output for 5.5.1
int(50501) a
Output for 5.5.0
int(50500) a
Output for 5.4.45
int(50445) a
Output for 5.4.44
int(50444) a
Output for 5.4.43
int(50443) a
Output for 5.4.42
int(50442) a
Output for 5.4.41
int(50441) a
Output for 5.4.40
int(50440) a
Output for 5.4.39
int(50439) a
Output for 5.4.38
int(50438) a
Output for 5.4.37
int(50437) a
Output for 5.4.36
int(50436) a
Output for 5.4.35
int(50435) a
Output for 5.4.34
int(50434) a
Output for 5.4.32
int(50432) a
Output for 5.4.31
int(50431) a
Output for 5.4.30
int(50430) a
Output for 5.4.29
int(50429) a
Output for 5.4.28
int(50428) a
Output for 5.4.27
int(50427) a
Output for 5.4.26
int(50426) a
Output for 5.4.25
int(50425) a
Output for 5.4.24
int(50424) a
Output for 5.4.23
int(50423) a
Output for 5.4.22
int(50422) a
Output for 5.4.21
int(50421) a
Output for 5.4.20
int(50420) a
Output for 5.4.19
int(50419) a
Output for 5.4.18
int(50418) a
Output for 5.4.17
int(50417) a
Output for 5.4.16
int(50416) a
Output for 5.4.15
int(50415) a
Output for 5.4.14
int(50414) a
Output for 5.4.13
int(50413) a
Output for 5.4.12
int(50412) a
Output for 5.4.11
int(50411) a
Output for 5.4.10
int(50410) a
Output for 5.4.9
int(50409) a
Output for 5.4.8
int(50408) a
Output for 5.4.7
int(50407) a
Output for 5.4.6
int(50406) a
Output for 5.4.5
int(50405) a
Output for 5.4.4
int(50404) a
Output for 5.4.3
int(50403) a
Output for 5.4.2
int(50402) a
Output for 5.4.1
int(50401) a
Output for 5.4.0
int(50400) a
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/P2RaB on line 15
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/P2RaB on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/P2RaB on line 12
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_OBJECT_OPERATOR in /in/P2RaB on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/P2RaB on line 12
Process exited with code 255.