3v4l.org

run code in 300+ PHP versions simultaneously
<?php class streamWrapper { public function stream_lock($operation ) { var_dump($operation); } public function stream_open($path, $mode, $options, $opened_path) { var_dump($path); return fopen($path, $mode); } } stream_wrapper_register('test', 'streamWrapper'); $fp = fopen('test://waa', 'w+'); flock($fp, LOCK_EX);
Output for 8.3.0 - 8.3.6
Deprecated: Creation of dynamic property streamWrapper::$context is deprecated in /in/P5EgZ on line 19 string(10) "test://waa" Warning: fopen(test://waa): Failed to open stream: infinite recursion prevented in /in/P5EgZ on line 13 Warning: fopen(test://waa): Failed to open stream: "streamWrapper::stream_open" call failed in /in/P5EgZ on line 19 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, false given in /in/P5EgZ:20 Stack trace: #0 /in/P5EgZ(20): flock(false, 2) #1 {main} thrown in /in/P5EgZ on line 20
Process exited with code 255.
Output for 8.2.0 - 8.2.18
Deprecated: Creation of dynamic property streamWrapper::$context is deprecated in /in/P5EgZ on line 19 string(10) "test://waa" Warning: fopen(test://waa): Failed to open stream: infinite recursion prevented in /in/P5EgZ on line 13 Warning: fopen(test://waa): Failed to open stream: "streamWrapper::stream_open" call failed in /in/P5EgZ on line 19 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /in/P5EgZ:20 Stack trace: #0 /in/P5EgZ(20): flock(false, 2) #1 {main} thrown in /in/P5EgZ on line 20
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
string(10) "test://waa" Warning: fopen(test://waa): Failed to open stream: infinite recursion prevented in /in/P5EgZ on line 13 Warning: fopen(test://waa): Failed to open stream: "streamWrapper::stream_open" call failed in /in/P5EgZ on line 19 Fatal error: Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /in/P5EgZ:20 Stack trace: #0 /in/P5EgZ(20): flock(false, 2) #1 {main} thrown in /in/P5EgZ on line 20
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
string(10) "test://waa" Warning: fopen(test://waa): failed to open stream: infinite recursion prevented in /in/P5EgZ on line 13 Warning: fopen(test://waa): failed to open stream: "streamWrapper::stream_open" call failed in /in/P5EgZ on line 19 Warning: flock() expects parameter 1 to be resource, bool given in /in/P5EgZ on line 20
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
string(10) "test://waa" Warning: fopen(test://waa): failed to open stream: infinite recursion prevented in /in/P5EgZ on line 13 Warning: fopen(test://waa): failed to open stream: "streamWrapper::stream_open" call failed in /in/P5EgZ on line 19 Warning: flock() expects parameter 1 to be resource, boolean given in /in/P5EgZ on line 20

preferences:
222.75 ms | 403 KiB | 315 Q