3v4l.org

run code in 300+ PHP versions simultaneously
<?php class cls {} $c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack); $c = $c->bindTo(new cls); $c();
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: Cannot bind method SplDoublyLinkedList::count() to object of class cls in /in/tpK16 on line 5 Fatal error: Uncaught Error: Value of type null is not callable in /in/tpK16:6 Stack trace: #0 {main} thrown in /in/tpK16 on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in /in/tpK16 on line 5 Fatal error: Uncaught Error: Function name must be a string in /in/tpK16:6 Stack trace: #0 {main} thrown in /in/tpK16 on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in /in/tpK16 on line 5 Fatal error: Uncaught Error: Function name must be a string in /in/tpK16:6 Stack trace: #0 {main} thrown in /in/tpK16 on line 6
Process exited with code 255.
Output for 5.6.15 - 5.6.28
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in /in/tpK16 on line 5 Fatal error: Function name must be a string in /in/tpK16 on line 6
Process exited with code 255.
Output for 5.4.1 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.14
Warning: Cannot bind function SplDoublyLinkedList::count to object of class cls in /in/tpK16 on line 5
Process exited with code 139.

preferences:
178.4 ms | 402 KiB | 271 Q