3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface bbqesq { function printSoda(); } class bbq implements bbqesq { var $soda; function printSoda(){ echo $this->soda; } } function doPrint(bbqesq $e) { $e->printSoda(); } $k = new bbq; $k->soda = 8675309; doPrint($e);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Warning: Undefined variable $e in /in/nSoMD on line 23 Fatal error: Uncaught TypeError: doPrint(): Argument #1 ($e) must be of type bbqesq, null given, called in /in/nSoMD on line 23 and defined in /in/nSoMD:15 Stack trace: #0 /in/nSoMD(23): doPrint(NULL) #1 {main} thrown in /in/nSoMD on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: e in /in/nSoMD on line 23 Fatal error: Uncaught TypeError: Argument 1 passed to doPrint() must implement interface bbqesq, null given, called in /in/nSoMD on line 23 and defined in /in/nSoMD:15 Stack trace: #0 /in/nSoMD(23): doPrint(NULL) #1 {main} thrown in /in/nSoMD on line 15
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught TypeError: Argument 1 passed to doPrint() must implement interface bbqesq, null given, called in /in/nSoMD on line 23 and defined in /in/nSoMD:15 Stack trace: #0 /in/nSoMD(23): doPrint(NULL) #1 {main} thrown in /in/nSoMD on line 15
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
Notice: Undefined variable: e in /in/nSoMD on line 23 Catchable fatal error: Argument 1 passed to doPrint() must implement interface bbqesq, null given, called in /in/nSoMD on line 23 and defined in /in/nSoMD on line 15
Process exited with code 255.

preferences:
192.48 ms | 402 KiB | 295 Q