3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function __toString() { return "bar";}} include (new foo);
based on fCDCb
Output for 5.2.0 - 7.1.0
Warning: include(bar): failed to open stream: No such file or directory in /in/781h0 on line 3 Warning: include(): Failed opening 'bar' for inclusion (include_path='.:') in /in/781h0 on line 3
Output for 5.1.0 - 5.1.6
Notice: Object of class foo to string conversion in /in/781h0 on line 3 Warning: include(Object): failed to open stream: No such file or directory in /in/781h0 on line 3 Warning: include(): Failed opening 'Object' for inclusion (include_path='.:') in /in/781h0 on line 3
Output for 5.0.0 - 5.0.5
Notice: Object of class foo to string conversion in /in/781h0 on line 3 Warning: main(Object): failed to open stream: No such file or directory in /in/781h0 on line 3 Warning: main(): Failed opening 'Object' for inclusion (include_path='.:') in /in/781h0 on line 3
Output for 4.3.2 - 4.4.9
Notice: Object to string conversion in /in/781h0 on line 3 Warning: main(Object): failed to open stream: No such file or directory in /in/781h0 on line 3 Warning: main(): Failed opening 'Object' for inclusion (include_path='.:') in /in/781h0 on line 3
Output for 4.3.0 - 4.3.1
Notice: Object to string conversion in /in/781h0 on line 3 Warning: main(Object) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/781h0 on line 3 Warning: main() [http://www.php.net/function.main]: Failed opening 'Object' for inclusion (include_path='.:') in /in/781h0 on line 3